NEWBIE: What's the instance name?

Paul Rubin http
Mon Dec 29 05:44:36 CET 2003


engsolnom at ipns.com writes:
> What I'd like to do is display is the instance name. Is it hiding
> somewhere?

You mean the name of variable where that the instance is bound to?  No.

> Also, if I have a string 4 chars long, representing two bytes of hex,
> how can I *validate* the string as a *legal* hex string?
> 
> isdigit works until string = '001A', for example
> isalnum works, but then allows 'foob'
> 
> Is there a 'ishexdigit'? I could parse the string, but that seems
> "un-Pythonish"

Just import string and use "d in string.hexdigits".




More information about the Python-list mailing list