On Thu, May 27, 2010 at 8:52 PM, Dipo Elegbede <delegb...@dudupay.com> wrote: > Hi all, > > I was reading through Alan Gauld's website: > http://www.alan-g.me.uk/l2p/index.htm > Under, Handling files, I copied the following codes and tried to run > it but it didn't. > I have written to him though but would like to get someone to look at > it for me again. > I have pasted the code in the pastebin and the link is as follows: > > http://pastebin.com/g6Ls6p9J.
This is how I learnt to use the interpreter and the Error messages it shows, to debug my code. # Run your script. # The interpreter barks, saying - NameError: global name 'readBook' is not defined # "But, I did define readBook, didn't I?", you wonder. Go back and confirm. You find a readBook. You are confused. # You run the script again, but the interpreter barks again! You are even more confused. # You re-read the error message. NameError: global name 'readBook' is not defined. You look back at the code more carefully, to find that indeed 'readBook' has not been defined. It was 'readbook' that was defined. readbook is not the same as readBook. Python is case sensitive. HTH ~punchagan > > Please help. > -- > Elegbede Muhammed Oladipupo > OCA > +2348077682428 > +2347042171716 > www.dudupay.com > Mobile Banking Solutions | Transaction Processing | Enterprise > Application Development > _______________________________________________ > BangPypers mailing list > BangPypers@python.org > http://mail.python.org/mailman/listinfo/bangpypers > _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers