home ~ projects ~ socials

Get The Current Directory Of A Python Script

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 --