Skip to content

Instantly share code, notes, and snippets.

@Lukse
Last active August 29, 2015 14:01
Show Gist options
  • Save Lukse/6bfdc39e7428e4462198 to your computer and use it in GitHub Desktop.
Save Lukse/6bfdc39e7428e4462198 to your computer and use it in GitHub Desktop.
Get execution directory
import os
def execution_directory():
exec_place = os.getcwd()
script_place = os.path.dirname(os.path.realpath(__file__))
arguments_place = str(sys.argv[0])
arguments_place = ("\\").join(arguments_place.split('\\')[0:-1])
return exec_place, script_place, arguments_place
print execution_folders()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment