this is my code, i'm trying to convert it to .exe, it works but does not open and read the text files, i did it on MacOs and works well, but does not work in windows
the problem is in this part
def make_house():
try:
server_Adress = entry_server.get()
pythonpPort = int(entry_port.get())
playerName = entry_player.get()
mc = Minecraft.create(server_Adress, pythonpPort, playerName)
xp,yp,zp=mc.player.getPos()
print("yes")
# file_name = os.getcwd() + '/house.txt'
print("yes")
my_file = open("/Users/me/Desktop/Python/python-projects/house.txt","r")
print("yes")
print(my_file)
for line in my_file:
nums = line.strip().split(" ")
x = int(nums[0]) + xp
y = int(nums[1]) + yp
z = int(nums[2]) + zp
b = int(nums[3])
mc.setBlock(x, y, z, b)
print("done")
except:
showerror(
"error", "please check your server address , port and player name")
the command i used:
pyinstaller filename.py --add-data 'pyramid.txt:.' --add-data 'house.txt:.' --windowed --onefile -i logo.ico