Answers for "python os path safe string"

0

python os path safe string

import re

invalidFile = "File!name?.txt"
f = open(os.path.join("/tmp", re.sub('[^-a-zA-Z0-9_.() ]+', '', invalidFile))
Posted by: Guest on October-05-2021

Python Answers by Framework

Browse Popular Code Answers by Language