The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

This topic is READ ONLY
falcon (2) [Avatar] Offline
#1
We have been unable to get our skier program to work. We have gone through the program twice and corrected the errors. We also saw on the "errata" page the comment on the double underscore before and after the __init__ code so we fixed that in four places. Now we have new errors. I have pasted them in below. Do you have any suggestions? Thank you. Stacy Hill. P.S.--My son is enjoying learning to program. Thanks for writing your book.

Traceback (most recent call last):
File "C:Users hehillfamily_2DocumentsCalebcalebprogrammingskier.py", line 83, in <module>
map0 = create_map(20, 29)
File "C:Users hehillfamily_2DocumentsCalebcalebprogrammingskier.py", line 58, in create_map
obstacle = ObstacleClass(img, location, type)
File "C:Users hehillfamily_2DocumentsCalebcalebprogrammingskier.py", line 33, in __init__
pygame.sprite.Sprite__init__(self)
AttributeError: 'module' object has no attribute 'Sprite__init__'
warren.sande (211) [Avatar] Offline
#2
Re: skier program
Glad your son is enjoying the book!

It looks like in line 33 you have:

pygame.sprite.Sprite__init__(self)

It should be

pygame.sprite.Sprite.__init__(self)

(There's a dot after "Sprite", before "__init__")

Once you fix this, if you have other errors, check very carefully for typos and especially indenting. If you're really stuck, post another message here, and we'll be happy to help.


Regards,
Warren Sande
falcon (2) [Avatar] Offline
#3
skier program working
Thank you for the quick response. The program is working now after we fixed four more "_" and "." errors!
taipan (3) [Avatar] Offline
#4
Re: skier program
Mr Sands,
Where are the location of the examples folder?

Thanks,
wai
taipan (3) [Avatar] Offline
#5
Re: skier program
Ignore prior request. I found the location of all files...

Thanks,
wai