Python Forum
Pygame in 90 Minutes - For Beginners syntax issues
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pygame in 90 Minutes - For Beginners syntax issues
#1
I am watching and copying the methods of how to make a game on Pygame via the video "Pygame in 90 Minutes - For Beginners" by Tech with Tim.

I wrote this code in idel

Python 3.11.3 (tags/v3.11.3:f3909b8, Apr 4 2023, 23:49:59) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> import pygame
pygame 2.4.0 (SDL 2.26.4, Python 3.11.3)
Hello from the pygame community. https://www.pygame.org/contribute.html
WIDTH, HEIGHT = 900, 500
WIN = pygame.display.set_mode((WIDTH, HEIGHT))
def main():
    run = True
    while run:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                run=False
                pygame.quit()
                if _name_ == "_main_":
                    Main()
Based on his work it should have opened up a blank window.

I got an invalid syntax message instead.

I am wondering what went wrong,

Thank you.
buran write Jun-07-2023, 09:45 AM:
Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.
Reply


Messages In This Thread
Pygame in 90 Minutes - For Beginners syntax issues - by GoldenHarvey - Jun-06-2023, 06:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Beginners to share pygame project? michael1789 4 3,168 Dec-04-2019, 07:17 AM
Last Post: michael1789
  [PyGame] Python pygame hangs up after 40 minutes chileflora 10 4,811 Jul-28-2019, 01:30 AM
Last Post: chileflora
  Beginners question Youmanity 4 3,833 Apr-08-2018, 07:02 PM
Last Post: Youmanity

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020