Pyglet is a module for Python allowing OpenGL support for Python through a simple API.

Examples Edit

Hello World Edit

import pyglet
ourwnd = pyglet.window.Window() # create a Window object
# create a Label
label = pyglet.text.Label('Hello, Python Wiki!',
                          font_name='Times New Roman',
                          x=ourwnd.width//2, y=ourwnd.height//2,
                          anchor_x='center', anchor_y='center')
# decorator meaning window event triggers follow
def on_draw():
# Run

Links Edit

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.