Primary tabs

Comments by User

Thursday, May 1, 2014 - 22:54

Great script, thank you!

I, too, have had issues with the dot in the name (some of my directory names have periods in them), so I fixed this by sticking the suffix in front of the LAST period, which ends up right before the filename extension. This will fail horribly if there is no filename extension, but that convention is fairly well established and the following should be platform independent:

def getFilename(filename, suffix):                                                                            
        lastDot = filename.rindex('.')                                                                        
        filename = filename[0:lastDot] + suffix + filename[lastDot:]                                          
        return filename