Is it possible to run pygame without creating a pygame window, surface or GUI? I want to utilize certain pygame functions, but I don't want a GUI popping up.
For example, this function won't work unless I have set up a window within pygame.
running = True
def mainloop():
while True:
for event in pygame.event.get():
if ( event.type == pygame.QUIT ) or \
( event.type == pygame.KEYDOWN and \
( event.key == pygame.K_ESCAPE) ):
running = False
print "quit"
pygame.quit()
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
print "working"