擅长:python、mysql、java
<p>嗯。。。如果我理解正确。。。</p>
<pre><code>def a_func(handle,color):
ctypes.windll.kernel32.SetConsoleTextAttribute(handle, color)
a_func(handle,AQUA)
</code></pre>
<p>或者更好</p>
<pre><code>colorFunc = ctypes.windll.kernel32.SetConsoleTextAttribute
colorFunc(handle,AQUA)
</code></pre>