擅长:python、mysql、java
<p>您想使用getattr(<a href="https://docs.python.org/3/library/functions.html#getattr" rel="nofollow">https://docs.python.org/3/library/functions.html#getattr</a>)</p>
<pre><code>facility = 'LOG_LOCAL7'
syslog.openlog( 'Blah', 0, getattr(syslog, facility))
</code></pre>