Say I have the following /home/my_user/files/path.py which contains print(os.getcwd()) and I from /home/ run
python3 ./my_user/files/path.py
I get the output /home/. Is there a way to print the folder of which the file being run is e.g /home/my_user/files independantly of where the file is run from?
 
     
     
    