This program's randomizer repeatedly produces lengthy runs of B's. Can I do anything to get a broader mix of results?
import random
import pyglet
#opens window
screen = pyglet.window.Window(fullscreen=True)
caption = pyglet.text.Label('press A',
font_name='Times New Roman',
font_size=72,
x=screen.width//2, y=screen.height//2,
anchor_x='center', anchor_y='center')
alternate= pyglet.text.Label('press B',
font_name='Times New Roman',
font_size=72,
x=screen.width//2, y=screen.height//2,
anchor_x='center', anchor_y='center')
def refresh(elapsed):
pick=random.SystemRandom().randint(1,2)
if pick==1:
screen.clear()
caption.draw()
else:
screen.clear()
alternate.draw()
pyglet.clock.schedule_interval(refresh,pick)
pyglet.app.run()