re: How to convert .py to .exe? Step by step guide. VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Hey buddy, thanks for creating this. I have a problem though: in my python script I call several files that are in the current working directory, b...
 

Hi!
1.What I usually do is get an absolute path so the script\scripts always know where they are

import os
dir = os.path.dirname(__file__)
abs_path = os.path.join(dir, DB_DOCS_NAME)
variable = open(abs_path)

2.If the main script is looking in the wrong place for other scripts then probably your imports are not correct.
Try to use this resource
realpython.com/absolute-vs-relativ...

Hope that I helped in some way

code of conduct - report abuse