lundi 13 juin 2016

Pygame compile() expected string without null bytes

So I'm new to pygame and I'm trying to compile the simplest program I can think of, to open a window. However, I tried two different compiling methods I found on the internet and both of them give me this:

error: compiling 'C:Python27libemailparser.py' failed
TypeError: compile() expected string without null bytes

I also found a thread on here that suggested import json and I tried that and it still didn't work.

Here's the code I'm using:

import pygame, sys
import json
from pygame.locals import *

pygame.init()
DISPLAYSURF = pygame.display.set_mode((400, 300))
pygame.display.set_caption('Hello World!')
while True: # main game loop
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()
    pygame.display.update()

I tried to use the code I found here: http://pygame.org/wiki/Pygame2exe?parent=

and here: http://pythoncentral.io/py2exe-python-to-exe-introduction/

What's happening here and how can I fix it?

Aucun commentaire:

Enregistrer un commentaire