0

I am reading the book "Python Programming 2nd Ed. for the absolute beginner" and I am having some trouble with a very simple program. I was instructed to download and install pygame and the livewires package as I have done. This program is meant to display a grahical window, that's it. But I'M getting the following error with the following code.

AttributeError: 'module' object has no attribute 'init' on line 6

# New Graphics Window
# Demonstrates creating a graphics window

from livewires import games

games.init(screen_width = 640, screen_height = 480, fps = 50)

games.Screen.mainloop()
5
Contributors
4
Replies
6
Views
8 Years
Discussion Span
Last Post by albo1125
0

I dont know about livewires, but did you type it all correctly? :p also, if you want todo games in python, i would just learn pygame directly. its powerful yet easy to understand

0

I receive the same error from running the same program from Dawson's book. Has anyone discovered a solution or work-around... other than abandoning livewires?

0

Yes, i have the solution. You have a typo ;) I'm learing from the same book, loving it, i'm on chapter 12.
games.Screen.mainloop(). Thats what you've got.
games.screen.mainloop(). Thats what you need (notice the capital letter S?)
Livewires rules :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.