[Tutor] Built-in function to check a character is ASCII character?

ammar azif ceasar102 at yahoo.com
Sat Mar 17 03:23:09 CET 2007


Is there any Built-in function to check whether  a character is an ASCII character?

I am trying to learn event driven programming in python. Heres my code:

while 1:
    key=msvcrt.getch()
    if key==255:
        continue
    else:
        print "the key is ", key


But the output is:-

the key is  ÿ
the key is  ÿ
the key is  ÿ
the key is  ÿ
the key is  ÿ
the key is  ÿ
the key is  ÿ
the key is  ÿ(infinite loop)

Why is this happening ? what is the  ÿ character?





 
---------------------------------
Now that's room service! Choose from over 150,000 hotels 
in 45,000 destinations on Yahoo! Travel to find your fit.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070316/6d4dd2b7/attachment.html 


More information about the Tutor mailing list