擅长:python、mysql、java
<p>如果你使用windows,我相信你可以使用<a href="https://pypi.python.org/pypi/SendKeys/" rel="nofollow noreferrer">SendKeys</a>来实现这一点。</p>
<p><a href="https://web.archive.org/web/20121125032946/http://www.rutherfurd.net/python/sendkeys" rel="nofollow noreferrer">http://www.rutherfurd.net/python/sendkeys</a></p>
<pre><code>import SendKeys
SendKeys.SendKeys("""
{CAPSLOCK}
{SCROLLOCK}
{NUMLOCK}
""")
</code></pre>