Skip to content

Instantly share code, notes, and snippets.

@marcusmonteiro
Last active April 17, 2018 18:36
Show Gist options
  • Save marcusmonteiro/7078b87cb2408d33056876dbd99e32a1 to your computer and use it in GitHub Desktop.
Save marcusmonteiro/7078b87cb2408d33056876dbd99e32a1 to your computer and use it in GitHub Desktop.
Get a file path using the directory where the script is executing as reference.
import os
here = os.path.dirname(os.path.abspath(__file__))
def local_file(file):
return os.path.join(here, file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment