check to see if a symbol in a string has a binding

Jinsong Zhao zhaojs at yahoo.com
Thu Apr 17 07:22:01 EDT 2003


Sorry if the question is too simple. I want to see if the name inside
the string has a binding and callable. For example,

1. func_string="func"
2. func_string="func_string"
3. func_string="dir"

So the in case 1, "func" does not have a binding; case 2 "func_string"
has a binding but not callable; in case 3 "dir" has a binding and is
callable. How do I proceed based on the content in func_string? This
is rather baffling.

Any suggestion? Thanks in advance.

Jinsong






More information about the Python-list mailing list