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)


Recommended Answers

All 4 Replies

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

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?

Any book that uses the hopelessly outdated livewires stuff should be dumped!

Member Avatar

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 :)

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.