Created
August 5, 2015 20:33
-
-
Save csytan/c4784e2aa4f4d64ce0be to your computer and use it in GitHub Desktop.
Python Module Paths
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# Current working directory | |
print(os.getcwd()) | |
# Module path (relative to cwd) | |
print(os.path.dirname(__file__)) | |
# Abs path of the current module's directory | |
print(os.path.dirname(os.path.realpath(__file__))) | |
print(os.path.dirname(os.path.abspath(__file__))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment