I have installed pygame and livewires but am getting the following error with the following short program that I got from my python book.

AttributeError: 'module' object has no attribute 'init'

# 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()

Edited 7 Years Ago by lewashby: n/a

I have installed pygame and livewires but am getting the following error with the following short program that I got from my python book.

AttributeError: 'module' object has no attribute 'init'

# 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()

I believe 'games.int' would only be used if you created that in a class, though never using livewires before, I believe the following code would work.

g = games(screen_width = 640, screen_height = 480, fps = 50)

Then just reuse the 'g', or any other chosen variable.

LiveWires is a pretty well dated Python course that uses a module called games as a wrapper for PyGame. It is supposed to make the use of PyGame easier for the beginner.

Looking over the module games.py, there is no init() method, unless there is a much newer version out.

Edited 7 Years Ago by vegaseat: games

LiveWires is a pretty well dated Python course that uses a module called games as a wrapper for PyGame. It is supposed to make the use of PyGame easier for the beginner.

Looking over the module games.py, there is no init() method, unless there is a much newer version out.

I wonder why my book "Python Programming 2nd Ed. for the absolute beginner" gave me that program. This is frustrating.

I suggest you simply use the module pygame directly, tell us what you want to do and show some effort, the rest of us will help. Many of us are familiar with pygame, but not with the old somewhat mind numbing livewires pygame wrapper.

This article has been dead for over six months. Start a new discussion instead.