Q:

python exe errors when running by an external program

I have python exe file which has been made using cx_Freeze. Basically The script uses the text file "XYZ.txt" to generate a word cloud. When I run the python exe file everything is fine and the code runs well, but I am planning to run it from an external program (a game which generates the text file) and when I'm trying to run it from that game, python exe runs but gives me the FileNotFoundError: [Error 2] No such file or directory: 'XYZ.txt'. But the 'XYZ.txt' actually is in the same folder and at the same time. Besides, I tried to run the text file from that game and it opened but the python exe cannot find it.
I have also tried to run my game as administrator and then running the python exe and then I got: "dll load failed the specified module could not be found" instead of the previous error.
I would be thankful if anyone could help me with that.

A:

please give the absolute path for 'XYZ.txt' in your python code. I guess that might solve the problem.

