I want to set relative path to folder with my executive script that will works from any machine without hardcoding absolute path to file. So far I have following:
import os
path_to_folder = os.path.realpath('.')
When I run my script from PyCharm
calling print(path_to_folder)
return correct path
C:\Users\Me\Desktop\Project\Script\
But if I try to call it from cmd
like python3.4 C:\Users\Me\Desktop\Project\Script\my_script.py
I get just
C:\Users\Me\
What is the more reliable way to set relative path?