Python Default Setting Path

This is a very basic way to set the default path to always be the same as where the script is running from.
So if the script has multiple files referenced then when moving the script instead of updating the paths for something such as opening a csv file, as long as the file is in the same relative location to the script, the script will be able to find it!

This would have saved me a lot of time had I known.

That’s it. The output if in two different directories, in my case testing and testing2 show the print output is different depending on where it is run from.

Leave a Comment

Your email address will not be published. Required fields are marked *