python change cwd to script directory

Solutions on MaxInterview for python change cwd to script directory by the best coders in the world

showing results for - "python change cwd to script directory"
Samuel
25 Apr 2016
1os.chdir(os.path.dirname(os.path.abspath(__file__)))
Silvana
08 Mar 2018
1abspath = os.path.abspath(__file__)
2dname = os.path.dirname(abspath)
3os.chdir(dname)