Thursday, 30 April 2020

How to change the current path in python?

import os, sys
BASEPATH = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, BASEPATH)
os.chdir(BASEPATH)

No comments:

Post a Comment