You can use copy / paste to get this code into Python so you don't have to type it again. (I wanted you to type it the first time so that you could begin to learn Python.)
# Import the pygame library and initialize the game engine import pygame pygame.init() # Define some colors BLACK = (0,0,0) WHITE = (255,255,255) # Open a new window size = (700, 500) screen = pygame.display.set_mode(size) pygame.display.set_caption("Pong") # The loop will carry on until the user exits # the game (e.g. clicks the close button). carryOn = True # The clock will be used to control how fast # the screen updates clock = pygame.time.Clock() # -------- Main Program Loop ----------- while carryOn: # --- Main event loop for event in pygame.event.get(): # User did something if event.type == pygame.QUIT: # If user clicked close carryOn = False # Flag that we are done # so we exit this loop # --- Game logic will go here # --- Drawing code should go here # First, clear the screen to black. screen.fill(BLACK) # Draw the net pygame.draw.line(screen, WHITE, [349, 0], [349, 500], 5) # --- Update the screen pygame.display.flip() # Once we have exited the main program loop # we can stop the game engine: pygame.quit()