to_range_strings¶
- igwn_segments.utils.to_range_strings(seglist)¶
Turn a segment list into a list of range strings as could be parsed by from_range_strings(). A typical use for this function is in machine-generating configuration files or command lines for other programs.
Example:
>>> from igwn_segments import * >>> segs = segmentlist([segment(0, 10), segment(35, 35), segment(100, infinity())]) >>> ",".join(to_range_strings(segs)) '0:10,35,100:'