How could I take out the previous folder before the file from filepath using python? I mean I would like this:
C:\Projects\ProjectX\Stuff\File1\File1.jpg
to be
C:\Projects\ProjectX\Stuff\File1.jpg
Edit: And if the File is allready in "Stuff"-folder and not any subfolders after that, then I would like to leave the filepath like it was.