2019年11月29日 12:58 阅读量:1788
需要用到的的包
boa-constructor-0.6.1.src.zip
pyHook-1.5.1-cp27-cp27m-win_amd64.whl
pynput-1.4.2-py2.py3-none-any.whl
wxPython-3.0.2.0-cp27-none-win_amd64.whl
安装wx
pip install wxPython-3.0.2.0-cp27-none-win_amd64.whl
C:\Python27\Lib\site-packages\
添加 wx.pth 文件内容 ./wx-3.0-msw
尝试安装 exe 版本的 pywin32 安装包
pip install pywin32
修改 wx 模块的 __init__.py
文件 (路径一般为 C:\Python27\Lib\site-packages\wx-3.0-msw\___init__.py
), 末尾添加一行:
NO_3D = 0
在boa根目录,找到 Palette.py,将 408行的语句
newButton = btnType(self, mID, None, wx.Point(self.posX, self.posY),
修改为
newButton = btnType(self, mID, None, wx.Point(self.posX, 0),
就可以正常使用了
注释都改为英文
在Python的Lib\site-packages文件夹下新建一个sitecustomize.py
文件,内容为:
#coding=utf8
import sys
reload(sys)
sys.setdefaultencoding('utf8')
pip install pyinstaller
pyinstaller -F App1.py -i 101.ico --noconsole
def __init__(self, frame:Frame1, event:threading.Event):
改为
def __init__(self, frame=Frame1, event=threading.Event):
基于windows桌面UI交互的(用py模拟鼠标点击事件,非后端模拟),退出桌面(远程连接断开)鼠标自动点击会失效.
解决方法:新建.bat文件,把下面代码粘贴进去
@%windir%\System32\tscon.exe 0 /dest:console
@%windir%\System32\tscon.exe 1 /dest:console
@%windir%\System32\tscon.exe 2 /dest:console
@%windir%\System32\tscon.exe 3 /dest:console
@%windir%\System32\tscon.exe 4 /dest:console
@%windir%\System32\tscon.exe 5 /dest:console
@%windir%\System32\tscon.exe 6 /dest:console
@%windir%\System32\tscon.exe 7 /dest:console
@%windir%\System32\tscon.exe 8 /dest:console
@%windir%\System32\tscon.exe 9 /dest:console