Skip to content

Instantly share code, notes, and snippets.

@crmackay
Last active August 29, 2015 14:11
Show Gist options
  • Save crmackay/0b8754a1e35bc2df2649 to your computer and use it in GitHub Desktop.
Save crmackay/0b8754a1e35bc2df2649 to your computer and use it in GitHub Desktop.
finding path of running file
import os
#path to direcory containing file
path = os.path.dirname(os.path.abspath(__file__))
# path to containing directory
path_above = os.path.split(path)[0]
# path to parellel directory
new_path = os.path.join((path_above, 'new_folder'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment