I am using py2app to convert a simple python pygame file into an app
I have two files, the setup file and a python window file and I enter "python /path py2app" and get no errors, but when I open window.app I get the error box below:
When I click on "Open Console" I see that the error that occurred was:
Console Error: ([0x0-0x178178].org.pythonmac.unspecified.window[2347]) Exited with code: 255
When I type python window.app in terminal I ge the error:
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't find '__main__' module in '/Users/williamfiset/dist/window.app'
window.py:
import pygame,sys
from pygame.locals import *
import pygame._view
black = ( 0, 0, 0)
pygame.init()
size=[700,500]
screen=pygame.display.set_mode(size)
clock = pygame.time.Clock()
# -------- Main Program Loop -----------
while True:
for event in pygame.event.get():
if event.type == QUIT:
isRunning = False
pygame.quit()
sys.exit()
screen.fill(black)
pygame.display.flip()
clock.tick(20)
setup.py:
from setuptools import setup
APP = ['window.py']
OPTIONS = {'argv_emulation': True, 'includes': ['EXTERNAL LIBRARY'],}
setup(
app=APP,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
When I replace the window.py file with the following I do not get any errors. The window opens fine without errors.
import Tkinter
t = Tkinter.Tk()
t.geometry("700x500+300+100")
t.mainloop()