擅长:python、mysql、java
<p>您可以从剪贴板中获取文本,而无需用户执行任何附加操作<code>raw_input()</code>即可粘贴多行文本:</p>
<pre><code>import Tkinter
root = Tkinter.Tk()
root.withdraw()
text = root.clipboard_get()
root.destroy()
</code></pre>
<p>另见<a href="https://stackoverflow.com/q/579687/4279">How do I copy a string to the clipboard on Windows using Python?</a></p>