Sorry for my bad english.
I want to learn how to program. I'm trying to learn from videos on YouTube.
And when I run my code in PyCharm - it does not work, that is, a window just appears, and then disappears.
If you run from a standard development environment - everything works as it should.
Please tell me what could be the problem.
And once again, sorry for the stupid questions.
If that application code:
win = pygame.display.set_mode((500, 500))
x = 50
y = 50
width = 40
heigth = 60
speed = 5
run = True
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
keys = pygame.key.get_pressed()
x -= speed
x += speed
y -= speed
y += speed
pygame.draw.rect(win, (0,0,255), (x, y, width, heigth))