How do I get the path used on terminal that called my Python script.
Example: with the terminal in $HOME, calling python -m my_script or even my_script I want to now that the script was called from $HOME folder.
1 Answer
You're describing the basic usage of os.getcwd().
os.getcwd()Return a string representing the current working directory.