python create valid filename from string

37

def cleanFilename(sourcestring,  removestring =" %:/,.\\[]<>*?"):
    #remove the undesireable characters
    return ''.join([c for c in sourcestring if c not in removestring])



################################################################

Comments

Submit
0 Comments