I am trying to make the Python module for testing a script stand-alone in a directory for scalability and ease of maintenance.
I did some research and could not 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 cd -in the shell.
I would usually like not to enter full path names and have all the paths relative to the given environment.
Example: I have my main directory where my scripts are located python-scripts, I have folders for each test environment demoand a folder from the screen for each test environment demo-screenshots.
If I wanted to save a screenshot to a screenshot from Python while working in a directory demo, I just send it to the directory below: demo-screenshotsusing the path '/demo-screenshots/example.png'. The problem is that I do not understand how to move the directory.
Thank.
source
share