plantage systematique de pygame
Comme dis dans le titre, la fenêtre pygame plante systématiquement au bout de 5 secondes précisément ( j'ai chronométré ), j'ai essayé un grand nombre de forums, mais aucun ne m'a donné ma réponse.
voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| import pygame
from pygame.locals import *
from threading import *
import threading
import time
def th ( ) :
tmp = 0
print "ok"
while tmp == 0 :
t = pygame.key.get_pressed ( )
a = 1
while a == a :
if t [a] == 1 :
print a
a = a + 1
if a == len ( t ) :
break
thread = threading.Thread ( target = th )
x = 0
y = 0
tmp = 0
pygame.init ( )
form = pygame.display.set_mode ( ( 800 , 600 ) )
thread.start ( )
pygame.display.flip()
while tmp == tmp :
pygame.display.flip() |
ne faite pas attention au thread, la problème étais la avant que je n’installe celui-ci.
autre chose, je suis sous windows vista pro ( je ne sais pas cela a une influence mais on sait jamais )