I have this python script which sits in
/some/folder/foo.py
So if I am in /some/folder and do
python foo.py
the script runs great. Now I want to take this path /some/folder as an argument, so that I can run this script when in different folder.
something like if I am in /a/different/folder and from this folder I want to execute
foo.py
How do i do this?
Thanks
Recommendation would be to do the opposite, accept a parameter to run the script in, if its not provided to current directory.
Then all you have to do is make sure foo.py is on your path.