Not getting clear output when using Pyglet

  pyglet, python-3.x

I am running this code that I copied from Pyglet’s documentation:

import pyglet
window = pyglet.window.Window()
label = pyglet.text.Label('Hello, world',
                          font_name='Times New Roman',
                          font_size=36,
                          x=window.width//2, y=window.height//2,
                          anchor_x='center', anchor_y='center')
@window.event
def on_draw():
    window.clear()
    label.draw()
pyglet.app.run()

The output I am getting is not clear and has a bunch of artifacts in it:
Window Output

I have already tried using a separate virtual environment and I got the same error on that.

Source: Python-3x Questions

LEAVE A COMMENT