Ask your own question, for FREE!
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW) 8 Online
OpenStudy (anonymous):

Starting Project 2 "Game of Life". I tried running the template and got an error that "Windows" name is undefined. Looked at graphics.py and it appears that there is only a Graphwin class. Changed statement in template file and now get a window to open, but hangs up because it does not find a canvasFrame class. Is there something else that needs to be imported? Thanks, Sigurd aka kj1k

OpenStudy (anonymous):

I just started as well. I haven't made any changes to template yet, but I didn't get the error you described. It created a blank window and then got a Python error looking for an __init__ method which I had not yet supplied.

OpenStudy (anonymous):

There is a Window class defined at line 836 in graphics.py right after the definition of the GraphWin class. I put some print statements into game_of_life.py right aftet the "Initialize Board" comment to make sure that the class was being created. It was. It sailed right through with no problem. I don't know why its not working for you.

OpenStudy (anonymous):

I am using graphics.py version 4.2.5, dated 5/26/2011. Are you using the same version? I don't see a Window class defined at all. Thanks, Sigurd aka kj1k

OpenStudy (anonymous):

I used the graphics.py and documentation linked to from the course page ( http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-189-a-gentle-introduction-to-programming-using-python-january-iap-2011/assignments/ ) The highest version number listed update history comments is Version 3.5 5/10/09.

OpenStudy (anonymous):

Thank you very much. Not sure how/why I got a later incompatible version of the library. Looks like it solved my immediate problem. Still have work to do, but this one is solved.

OpenStudy (anonymous):

You are very welcome. Just got the simulate step to work (I think). Was confusing in that I forgot that a "for" loop on a dictionary returns the keys, not the item from the dictionary whose value is obtained with the key. I thought I had a "block" when in fact I had a tuple. I wasn't sure what "toad" was supposed to do. The simulate changed the grid and I had to work it out by hand to be sure it was correct.

OpenStudy (anonymous):

I'm thinking that the pulsar block list may be incorrect or incomplete. It went through 8 changes and then became a fixed pattern. It didn't look like the picture from the Conway Wiki.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!