Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

set current working directory automatically in Python

import inspect
import os

module_path = inspect.getfile(inspect.currentframe())
module_dir = os.path.realpath(os.path.dirname(module_path))
os.chdir(module_dir)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #current #working #directory #automatically #Python
ADD COMMENT
Topic
Name
6+6 =