I recently posted a very small program the uses pygame and the livewires package but was unable to get the program to run. I think the Title for that posting was Graphics Window or something close to that anyway. Since I can't resolve that problem, does anyone have any suggestions as to another way I could use pygame along with the livewires packege to accomplish that task? Thanks.

Recommended Answers

All 2 Replies

pygame and the livewires package but was unable to get the program to run

Forget about livewires package,it is outdatet and not smart to use at all if you what to learn pygame.

If you want to look pygame you have to do as everyone else.
All tutorials on net are for pygame,none for livewires package.

A simple window with som graphics.

import pygame

#----| Initialize PyGame |---#
pygame.init()

#---| Create window |---#
screen = pygame.display.set_mode((615, 400))                      

#---| Window color |---#                              
screen.fill((100, 0, 0)) #Red

#---| Set name window |---#
pygame.display.set_caption('My pygame window')

#---| variabler color(r, g, b) and size/placement |---#
white = (255, 255, 255)
black = (0, 0, 0)
red = (255, 0, 0)
yellow = (255, 255, 0)
#---
radius = 50
center = (150, 150)
center_1 = (450,150)

#---| draw white circles |---#
pygame.draw.circle(screen, white, center, radius)
pygame.draw.circle(screen, white, center_1, radius)

#---| draw a yellow square |---#
pygame.draw.rect(screen, yellow,(220, 250, 150, 100))

#---| Display screen graphics|---#
pygame.display.flip()

while True:
    event = pygame.event.poll()
    if event.type == pygame.QUIT:
        break

I agree with snippsat, don't tie yourself down with an outdated book and outdated custom modules.

Pygame has come out for Python3, and will be around for hopefully more than just a few years. If you learn pygame programming directly, you have learned something worthwhile.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.