Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geany as IDE for Python-Pygame #1005

Closed
ghost opened this issue Apr 23, 2016 · 4 comments
Closed

Geany as IDE for Python-Pygame #1005

ghost opened this issue Apr 23, 2016 · 4 comments
Labels

Comments

@ghost
Copy link

ghost commented Apr 23, 2016

I have started to use Geany 1.25 as IDE for pygame, so i am not quit sure whether this i a geany bug or i am doing something wrong. I tested the following and the problem is that by clicking on the close button nothing happens and the pygame window dosn't close (which actually should happen!). Can anyone help me with this? I am on an ubuntu 15.10 machine and have installed geany from its software center.

import pygame
from pygame.locals import *

pygame.init()

RED=(100,0,0)

screen=pygame.display.set_mode([500,500])

screen.fill(RED)

runs=True

while runs:
    for e in pygame.event.get():
        if e.type==QUIT:
            runs==False
    pygame.display.flip()

pygame.quit()
@codebrainz
Copy link
Member

The runs==False looks wrong, but I think it should cause a compile error, not do something weird at runtime like C/C++ would.

You could try sticking print("Quitting") in the if e.type == QUIT block. If it prints "Quitting" when you press the close button, try replacing it with sys.exit() and see if it quits.

@ghost
Copy link
Author

ghost commented Apr 23, 2016

Hello and thanks for your help. I did what you said and it works! On other editores however i only having a pygame.quit() would suffice to close the window. Why is this not the case on the GREAT Geany?
(I really just started to work in geany and loved it immidiately, i think i have now found lastly the editor i can enjoy!)

@ghost
Copy link
Author

ghost commented Apr 23, 2016

Okey , i see my typing problem now, it should be runs=False not runs==False.

@b4n b4n added the invalid label Apr 23, 2016
@b4n b4n closed this as completed Apr 23, 2016
@codebrainz
Copy link
Member

I guess I over-estimated Python's compiler, indeed it gives no warnings for using an expression statement like that, and just discards the boolean result of the comparison (or in interactive interpreter, prints 'False').

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants