import pyglet
from pyglet.window import *
a = 50
window = pyglet.window.Window(width=640, height=360, fullscreen=False)
label = pyglet.text.Label(str(a), font_name = 'Amstrad CPC Accentued', font_size=12, x=320, y=180, anchor_x='center', anchor_y='center')
@window.event
def on_draw():
window.clear()
label.draw()
def on_key_press(symbol, modifiers):
global a
global label
if symbol == key.LEFT and a > 0:
a -= 1
elif symbol == key.RIGHT and a < 100:
a += 1
label.text = str(a)
label.draw()
pyglet.app.run()
Malheureusement, le bouzin ne fait rien du tout. Il prend bien en compte les touches (Mon compteur Fraps s'affolant un peu), mais le texte ne se met pas à jour

Et mes recherches Google ont fait chou blanc pour un putain de truc aussi simple

Qu'est-ce que j'ai loupé ???