Get The Current Directory Of A Python Script

May 2021

Using `os.getcwd()python produces the current working directory of a python script in the same way `pwdbash does on the command line

import os

print(os.getcwd())
Output:
/Users/alan/Grimoire
end of line