making a valid file name...
Jerry
jweida at gmail.com
Tue Oct 17 12:29:24 EDT 2006
More information about the Python-list mailing list
Tue Oct 17 12:29:24 EDT 2006
- Previous message (by thread): Return returns nothing in recursive function
- Next message (by thread): making a valid file name...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I would suggest something like string.maketrans http://docs.python.org/lib/node41.html. I don't remember exactly how it works, but I think it's something like >>> invalid_chars = "abc" >>> replace_chars = "123" >>> char_map = string.maketrans(invalid_chars, replace_chars) >>> filename = "abc123.txt" >>> filename.translate(charmap) '123123.txt' -- Jerry
- Previous message (by thread): Return returns nothing in recursive function
- Next message (by thread): making a valid file name...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list