Reading a portion of a file

cmfvulcanius at gmail.com cmfvulcanius at gmail.com
Thu Mar 8 11:12:27 EST 2007


I am using a script with a single file containing all data in multiple
sections. Each section begins with "#VS:CMD:command:START" and ends
with "#VS:CMD:command:STOP". There is a blank line in between each
section. I'm looking for the best way to grab one section at a time.
Will I have to read the entire file to a string and parse it further
or is it possible to grab the section directly when doing a read? I'm
guessing regex is the best possible way. Any help is greatly
appreciated.

Thanks




More information about the Python-list mailing list