Skip to content

Instantly share code, notes, and snippets.

@jmquintana79
Last active August 18, 2016 05:43
Show Gist options
  • Save jmquintana79/44ed5cfd8bb0766f6a4c to your computer and use it in GitHub Desktop.
Save jmquintana79/44ed5cfd8bb0766f6a4c to your computer and use it in GitHub Desktop.
Get full path of current folder
import os
# For getting the current directory of your script:
os.path.dirname(os.path.abspath(__file__))
#For getting the current working directory:
os.getcwd()
# Build a path
os.path.join("folder1","folder2","file")
# Split path in folder and filename
folder, filename = os.path.split(path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment