Title. I have 3 files. 1 main file, to run the script. 1 function file, that holds the functions that the script uses. And 1 data file, that holds the variables that the script accesses. When I use pyinstaller to compile the main function to an exe, despite many attempts with a bunch of different options, (--onefile, --add-data, etc.) I haven't been able to figure out how to fix it. More detailed view on my setup:
# data file
my_bool = False
# functions file
def my_func():
from data_file import my_bool
my_bool = not my_bool
# main script
from data_file import my_bool
from functions_file import my_func
print(my_bool)
my_func()
print(my_bool)
For me, this actually does what it's supposed to do perfectly fine before the files are attempted to be compiled. Of course this isn't my actual setup but it does work like I expected after checking it, outputting:
False
True
So after all that explanation, I'm just wondering how I can fix this issue. I assume it has something to do with how I import everything, but how should I fix that? I always could, but I don't want to be forced to rewrite this whole project over one small, probably fixable issue. Thanks in advance