Get path where python file is called

1

I created a python file and left it available to access from every location on the system, but for many applications I need the path where the python file was called by the system, but I did not find any way to get this value on the internet, someone can you help me?

    
asked by anonymous 15.08.2017 / 19:19

1 answer

2

You can use the getcwd method of the libraries

It returns your current working directory

import os
print(os.getcwd())

See working at Repl.it

If you want to read a bit more: os.getcwd

    
15.08.2017 / 19:25