I am attempting to make a Python testing script module self-contained directory-wise for scalability and maintainability purposes.
I have done some research and haven't been able to find the answer i'm looking for. Basically, I would like to determine if there is a function in Python that can do something similar to
You're looking to change the working directory? The OS module in python has a lot of functions to help with this.
import os os.chdir( path )
".." to go up one directory. If you need to check where you are before/after a change of directory you can issue the
mycwd = os.getcwd() os.chdir("..") #do stuff in parent directory os.chdir(mycwd) # go back where you came from