I built a program that needs to be started at window startup and it has problem when loading a file.
for example, let’s say that the path of my app is :
c:dir1dir2app.exe
This app.exe is built by cx_freeze.
And there is a file named :
c:dir1dir2file.json
To make this app run at the beginning of the startup of window, I made a shortcut in the startup directory, and editted the registry using winreg
.
The problem is : my app has a code that is named :
file = open(os.getcwd() + '/file.json','r')
And when this runs at startup, the path is where the shortcut is, not c:dir1dir2
.
What I want is to make my app somehow read c:dir1dir2
when the window start, by making txt file in c:, etc. What is the general solution of this problem ? I think it is matter of my lack of knowledge, not difficulty of problem.