>    File "C:\Documents and Settings\Tom C\My Documents\Python
projects -
> Toms\quiz\quiz.py", line 13, in __main__
>      KeyIn = getch()
> NameError: name 'getch' is not defined
>

Have you actually imported the msvcrt module?
And if so did you import kbhit and getch since you aren't prefixing
the names with the module?

Normally I'd expect to see

Keyln = msvcrt.getch()

> a=kbhit()
>
> Traceback (most recent call last):
> [snip]
> File "<console>", line 0, in __main__
> NameError: name 'defined' is not defined

That looks more like you tried to execute an error message by mistake!

Alan G
Author of the Learn to Program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to