Unable to run annoying_message.py using Visual Studio Code
I'm a programmer with quite some years of experience, but completely new with Python. I'm currently trying to run annoying_message.py from PyGaze to get familiarized with it, but it's not working properly. I'm running this using Windows 10, Visual Studio Code and Python 3.6 32bits with Pygaze 0.7 (obtained using pip). I think the error is when I try to use draw_text() because I have another example where I load an image instead of text in the Display() and it works fine! This is the code, and it's pretty much what the py file contains:
# your message
MESSAGE = "HELLO WORLD"
# import stuff
from pygaze.defaults import *
from pygaze import libtime
from pygaze.libscreen import Display, Screen
from pygaze.libinput import Keyboard
# start timing
disp = Display()
scr = Screen()
kb = Keyboard(keylist=['space'],timeout=1)
# run annoying message
while kb.get_key() == None:
col = (random.randint(0,255), random.randint(0,255), random.randint(0,255))
pos = (random.randint(0,DISPSIZE), random.randint(0,DISPSIZE))
scr.draw_text(text=MESSAGE, colour=col, pos=pos, fontsize=84)
# reset screen
# stop the madness
I haven't been able to identify the issue, because as soon as Display() is called, I only see the PyGame community message in the terminal, and a grey screen covering the whole screen, which I understand is the actual Display object that I called, but it does not allow me to go back to Visual Studio Code and keep debugging. I'm not able to go through each line of code because the grey screen seems to put everything else "frozen" while runs.
I would appreciate the help, thanks!