Skip to content

Instantly share code, notes, and snippets.

@happysundar
Created February 27, 2014 23:04
Show Gist options
  • Save happysundar/9261574 to your computer and use it in GitHub Desktop.
Save happysundar/9261574 to your computer and use it in GitHub Desktop.
How to find the path of the current (executing) python script From http://stackoverflow.com/questions/3718657/how-to-properly-determine-current-script-directory-in-python
__filename = inspect.getframeinfo(inspect.currentframe()).filename
__path = os.path.dirname(os.path.abspath(filename))
# And then, do something like:
if not os.path.isabs(arguments['--bound-spec']):
arguments['--bound-spec'] = os.path.normpath(os.path.join(__path, arguments['--bound-spec']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment