В следующем коде, как сделать данные Unicode доступными для вызова. Ошибка, которую я получаю, это //TypeError: 'unicode' object is not callable
def test(test_config):
for i in test_config:
print i.header //prints func1
print type(i.header) // prints unicode
try:
#i.header()//TypeError: 'unicode' object is not callable
func = globals()[i.header]
print func # found it
func()
except AttributeError:
logging.error("Method %s not implemented"%(i.header))
def func1():
print "In func1"
test(u'func1')
i.header
? - person shx2   schedule 22.11.2013"print" ('Hello World.')
сработает? Если да, то в питоне так не работает. - person Hyperboreus   schedule 22.11.2013