pyperclip在控制台中工作,但不在脚本中工作

时间:2017-12-02 13:21:26

标签: python pyperclip

$ python
Python 2.7.12 (default, Nov 20 2017, 18:23:56) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyperclip
>>> pyperclip.copy('The text to be copied to the clipboard.')
例如,

正确设置我的剪贴板,但下面的脚本没有,有什么区别?

$ cat example_pyperclip.py
#!/usr/local/bin/python
import pyperclip
pyperclip.copy('The text to be copied to the clipboard.')
print("script is done")

输出

$ python example_pyperclip.py 
script is done

0 个答案:

没有答案