Nov-28-2023, 09:54 PM
Hello,
if have a Python-script in, let's say
I add this to the windows path variable:
Then I open a shell at d:\working. When I invoke the script with
how can I get the directory from which I invoke the script, so d:\working in this case.
Commands like os.getcwd() only returns the script directory d:\script
Any Ideas?
Thanks
Stephan
if have a Python-script in, let's say
d:\script\myScript.py
I add this to the windows path variable:
PATH="...;d:\script;..."
Then I open a shell at d:\working. When I invoke the script with
d:\working>myScript.py
how can I get the directory from which I invoke the script, so d:\working in this case.
Commands like os.getcwd() only returns the script directory d:\script
Any Ideas?
Thanks
Stephan