1

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 1

2

You're describing the basic usage of os.getcwd().

os.getcwd() Return a string representing the current working directory.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.