I'm trying to import data from .py files, but when I run my game as an exe (I used pyinstaller to make my game into an exe), It dosen't work. I dont get an error or anything, it just dosent import the data. The weird thing is that when running this from IDLE, it works perfectly fine.
def achivementcheck():
f = open("simplesavedata.py", "w")
f.write("achivements = " + str(achivements) + "\n")
f.close()
def option_save():
f = open("optiondata.py", "w")
f.write("volume = " + str(volume))
f.close
from simplesavedata import *
from optiondata import *
EDIT: My game code
import random
import pickle
import os
from just_playback import Playback
import sys
playback = Playback()
init(convert=True)
volume = 0
achivements = 0
achivename = 0
def achivementcheck():
f = open("simplesavedata.py", "w")
f.write("achivements = " + str(achivements) + "\n")
f.write("achivename = " + str(achivename) + "\n")
f.close()
def option_save():
f = open("optiondata.py", "w")
f.write("volume = " + str(volume))
f.close
#load saved data
from simplesavedata import *
from optiondata import *
playback.load_file("music/titlescreen.mp3")
playback.play()
playback.loop_at_end(True)
name = input("What is your name? ")
if name == "test":
print("Test achivement")
achivements += 1
achivename += 1
achivementcheck():
print("achivements = ", achivements)
print(gotten achivename", achivename, "times")