Idiomatic portable way to strip line endings?
Ulf Magnusson
ulf.magnusson at ubm-computing.com
Sun Dec 16 10:56:27 EST 2001
More information about the Python-list mailing list
Sun Dec 16 10:56:27 EST 2001
- Previous message (by thread): Idiomatic portable way to strip line endings?
- Next message (by thread): Idiomatic portable way to strip line endings?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> In general, I can use: > > line = line[:-1] > or > del line[-1:] > snip... > TIA, There is an easy way to print them without the newline print "hello world", Use a comma attached at the end, this ofcourse doesn't modify the string (strings are unmutable) but it fixes the print output. the string module also supports the following rstrip, strip, lstrip which removes whitespaces (on the right side, the whole string, left side) Cheers /U. Magnusson
- Previous message (by thread): Idiomatic portable way to strip line endings?
- Next message (by thread): Idiomatic portable way to strip line endings?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list