How to check the exists of a name?

David 71david at libero.it
Sun Oct 18 02:46:00 EDT 2009


Il Sat, 17 Oct 2009 23:43:36 -0700 (PDT), StarWing ha scritto:

> I got a idea, use a try...except statement. there are another way to
> do it ?
> 
> (I just curious now, because I solve my problem in another way :-)

locals().has_key(myname) 
globals().has_key(myname)

D.



More information about the Python-list mailing list