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