Help on built-in function getattr in module __builtin__:
getattr(...)getattr(object, name[, default]) -> value
Get a named attribute from an object; getattr(x, 'y') is equivalent to x.y.
When a default argument is given, it is returned when the attribute doesn't
exist; without it, an exception is raised in that case.
要回答第一部分,您需要
getattr
:所以你需要:
关于你问题的第二部分,关于陈述本身的细目:
syslog
(模块).
(scope resolution operator)openlog
(模块的一个属性,在本例中是一个函数)'Blah'
(函数的一个参数)您想使用getattr(https://docs.python.org/3/library/functions.html#getattr)
相关问题 更多 >
编程相关推荐