sanitize

Turn a string into a valid filename?

Turn a string into a valid filename? Question: I have a string that I want to use as a filename, so I want to remove all characters that wouldn’t be allowed in filenames, using Python. I’d rather be strict than otherwise, so let’s say I want to retain only letters, digits, and a small set …

Total answers: 27