formatting strings to have the same width
spohle
spohle at gmail.com
Sat Mar 17 19:07:44 EDT 2007
More information about the Python-list mailing list
Sat Mar 17 19:07:44 EDT 2007
- Previous message (by thread): formatting strings to have the same width
- Next message (by thread): formatting strings to have the same width
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
hi, i got random strings and wanna attach a " | " at the end. now if i print them i want the | to always be underneath each other. example code: foo = ["aaa", "1232"] for each in foo: print foo[0].center(10, " ") + " | " foo2 = "1232" print foo2.center(10, " ") + " | " even though i define a constant width on the strings the | don't show up underneath each other. any ideas ?
- Previous message (by thread): formatting strings to have the same width
- Next message (by thread): formatting strings to have the same width
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list