Fixed length lists from .split()?
Bob Greschke
bob at passcal.nmt.edu
Thu Feb 1 14:40:04 EST 2007
More information about the Python-list mailing list
Thu Feb 1 14:40:04 EST 2007
- Previous message (by thread): how to make a python windows service know it's own identity
- Next message (by thread): Fixed length lists from .split()?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
This idiom is what I ended up using (a lot it turns out!):
Parts = Line.split(";")
Parts += (x-len(Parts))*[""]
where x knows how long the line should be. If the line already has
more parts than x (i.e. [""] gets multiplied by a negative number)
nothing seems to happen which is just fine in this program's case.
Bob
- Previous message (by thread): how to make a python windows service know it's own identity
- Next message (by thread): Fixed length lists from .split()?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list