I have this program Namechange.py which changes names from files (always cuts some useless end). Everything works fine, but I use this file a lot in a lot of different directories, which is bothersome when I want to change something. What I'm searching for is a python script which let's me execute this script in a directory I choose.
My first idea was that I run another script which copies Namechange.py in the desired directory and then executes it there and deletes it after everythings finished. The copying part works. Till now I tried using symlink ( it just executed the script in the working directory :D) as well as the subprocess module, which says there is no such directory when I use:
subprocess.call(["cd", newpath])
newpath is the absolute path to the directory I want to use the script.
with error OSError: [Errno 2] No such file or directory.
If somebody has a elegant way to achieve this I would be glad.
Thanks and goodbye