import pyperclip
import string
text = pyperclip.paste()
text = text.replace('
',' ')
text = text.strip()#行末尾去空格,行头空格也去
pyperclip.copy(text)
这是te.py
下面是编译脚本f.py
from distutils.core import setup
import py2exe
setup(windows=["te.py"])#用windows可以防止弹出黑框,用console可以弹出交互窗口
编译:cmd打开,cd到文件夹
python f.py py2exe
ok!