0

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 by lewashby: n/a

4
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by vegaseat
0

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.

0

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 by vegaseat: games

0

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.

0

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 topic has been dead for over six months. 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.