def filename_addstring ( filename , text ) : fn , ext = os . path . splitext ( filename ) return fn + text + ext
how to append text file name in python
Add text to filename keeping the extension in place For example when adding a timestamp to the filename
def filename_addstring(filename, text):
    """
    Add `text` to filename, keeping the extension in place
    For example when adding a timestamp to the filename
    """
    fn, ext = os.path.splitext(filename)
    return fn + text + ext