title: Is it possible to specify the previous directory python?
body: <p>I am attempting to make a Python testing script module self-contained directory-wise for scalability and maintainability purposes.</p>
  
  <p>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 <code>cd -</code> in shell. </p>
  
  <p>I would generally like to avoid typing in full path-names, and have all the paths relative to a specified environment.</p>
  
  <p>Example:
  I have my main directory where my scripts are located <code>python-scripts</code>, I have folders for each testing environment <code>demo</code>, and a screenshot folder for each testing environment <code>demo-screenshots</code>.</p>
  
  <p>If i wanted to save a screenshot to the screenshot with Python, while working in the <code>demo</code> directory, I would just send it to the directory below: <code>demo-screenshots</code>, using the path <code>'/demo-screenshots/example.png'</code>. The problem is that I don't understand how to move back a directory.</p>
  
  <p>Thank you.</p>