Create a range list of numbers freely
I couldn't install it with python2.7, so I ran it with python3.5.
rangeparser.py
# -*- coding: utf-8 -*-
from rangeparser import RangeParser
parser = RangeParser()
print(parser.parse('10,20,30'))
# [10, 20, 30]
print(parser.parse('1-10'))
# [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
print(parser.parse('10,20,30,40-45'))
# [10, 20, 30, 40, 41, 42, 43, 44, 45]
Recommended Posts