View Single Post
Old Jan 23rd, 2008, 5:33 PM   #29
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,886
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: My pyguessinggame

By the way, for clarification, "bugs" can be logical or syntactical. So it's not entirely "debugged" yet, because you still have "raw_imput" where it should be "raw_input".

You also have:

   if __name__ == '__main__':
      start()
      print
      raw_input('press return')
   else:
      print 'Module guessgame imported'
      print 'to run, type:guessgame.start()'
      print 'to refresh, type:reload (guessgame)'

On the wrong indentation level. Do you understand what it means for a block to be indented? Indentation specifies to which block a line of code belongs. By indenting all that, you're saying it belongs to the function, which it doesn't. It belongs to the main flow of the program on the first indentation level.

Edit: That's the reason it just pops up and exits, because there are still run-time errors. You should be able to run the program from IDLE (Python GUI) by pressing F5 when you have the script opened up for editing.
Sane is offline   Reply With Quote