10029f9f by huangyf2

update

1 parent 26c8727b
1 dist 1 dist
2 build 2 build
3 __pycache__ 3 __pycache__
...\ No newline at end of file ...\ No newline at end of file
4 exe
...\ No newline at end of file ...\ No newline at end of file
......
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
1 # -*- mode: python ; coding: utf-8 -*-
2
3
4 a = Analysis(
5 ['we.py'],
6 pathex=[],
7 binaries=[],
8 datas=[('data', 'data')],
9 hiddenimports=[],
10 hookspath=[],
11 hooksconfig={},
12 runtime_hooks=[],
13 excludes=[],
14 noarchive=False,
15 optimize=0,
16 )
17 pyz = PYZ(a.pure)
18
19 exe = EXE(
20 pyz,
21 a.scripts,
22 a.binaries,
23 a.datas,
24 [],
25 name='ble_client',
26 debug=False,
27 bootloader_ignore_signals=False,
28 strip=False,
29 upx=True,
30 upx_exclude=[],
31 runtime_tmpdir=None,
32 console=True,
33 disable_windowed_traceback=False,
34 argv_emulation=False,
35 target_arch=None,
36 codesign_identity=None,
37 entitlements_file=None,
38 icon=['data\\app.ico'],
39 )
This diff is collapsed. Click to expand it.
1 # -*- mode: python ; coding: utf-8 -*-
2
3
4 a = Analysis(
5 ['m.py'],
6 pathex=[],
7 binaries=[],
8 datas=[('data', 'data')],
9 hiddenimports=[],
10 hookspath=[],
11 hooksconfig={},
12 runtime_hooks=[],
13 excludes=[],
14 noarchive=False,
15 optimize=0,
16 )
17 pyz = PYZ(a.pure)
18
19 exe = EXE(
20 pyz,
21 a.scripts,
22 a.binaries,
23 a.datas,
24 [],
25 name='m',
26 debug=False,
27 bootloader_ignore_signals=False,
28 strip=False,
29 upx=True,
30 upx_exclude=[],
31 runtime_tmpdir=None,
32 console=True,
33 disable_windowed_traceback=False,
34 argv_emulation=False,
35 target_arch=None,
36 codesign_identity=None,
37 entitlements_file=None,
38 icon=['data\\app.ico'],
39 )
pythonserver @ 65948850
1 Subproject commit 659488506d3926a24a8012358231b8345c52e618
This diff is collapsed. Click to expand it.
1 # -*- mode: python ; coding: utf-8 -*-
2
3
4 a = Analysis(
5 ['qt5.py'],
6 pathex=[],
7 binaries=[],
8 datas=[('data', 'data')],
9 hiddenimports=[],
10 hookspath=[],
11 hooksconfig={},
12 runtime_hooks=[],
13 excludes=[],
14 noarchive=False,
15 optimize=0,
16 )
17 pyz = PYZ(a.pure)
18
19 exe = EXE(
20 pyz,
21 a.scripts,
22 a.binaries,
23 a.datas,
24 [],
25 name='qt5',
26 debug=False,
27 bootloader_ignore_signals=False,
28 strip=False,
29 upx=True,
30 upx_exclude=[],
31 runtime_tmpdir=None,
32 console=True,
33 disable_windowed_traceback=False,
34 argv_emulation=False,
35 target_arch=None,
36 codesign_identity=None,
37 entitlements_file=None,
38 icon=['data\\app.ico'],
39 )
...@@ -27,7 +27,9 @@ pip install pystray pillow ...@@ -27,7 +27,9 @@ pip install pystray pillow
27 27
28 ## 28 ##
29 打包指令 产生一个带窗口的程序 打包完后可以随便改exe 名字 29 打包指令 产生一个带窗口的程序 打包完后可以随便改exe 名字
30 C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\Scripts\pyinstaller.exe --onefile --icon=data\app.ico we.py --add-data "data;data" 30 C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\Scripts\pyinstaller.exe -F --hidden-import=bleak.backends --hidden-import=asyncio --win-private-assemblies --onefile --icon=data\app.ico we.py --add-data "data;data"
31
32 C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\Scripts\pyinstaller.exe --onefile --windowed --name=ble_client --icon=data\app.ico we.py --add-data "data;data"
31 33
32 ## 34 ##
33 端口占用 35 端口占用
......
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 # -*- mode: python ; coding: utf-8 -*-
2
3
4 a = Analysis(
5 ['s6.9.2.py'],
6 pathex=[],
7 binaries=[],
8 datas=[('data', 'data')],
9 hiddenimports=['bleak.backends', 'asyncio'],
10 hookspath=[],
11 hooksconfig={},
12 runtime_hooks=[],
13 excludes=[],
14 noarchive=False,
15 optimize=0,
16 )
17 pyz = PYZ(a.pure)
18
19 exe = EXE(
20 pyz,
21 a.scripts,
22 a.binaries,
23 a.datas,
24 [],
25 name='s6.9.2',
26 debug=False,
27 bootloader_ignore_signals=False,
28 strip=False,
29 upx=True,
30 upx_exclude=[],
31 runtime_tmpdir=None,
32 console=True,
33 disable_windowed_traceback=False,
34 argv_emulation=False,
35 target_arch=None,
36 codesign_identity=None,
37 entitlements_file=None,
38 icon=['data\\app.ico'],
39 )
1 import pystray 1 import pystray
2 from PIL import Image, ImageDraw 2 from PIL import Image
3 import threading 3 import threading
4 import os
5 import sys
4 6
5 def create_image(width, height, color1, color2): 7 def load_icon(icon_path):
6 image = Image.new("RGB", (width, height), color1) 8 """加载图标文件"""
7 dc = ImageDraw.Draw(image) 9 try:
8 dc.rectangle((width // 2, 0, width, height // 2), fill=color2) 10 return Image.open(icon_path)
9 return image 11 except FileNotFoundError:
12 print(f"Icon file not found at {icon_path}")
13 return None
14
15 def on_exit(icon, item):
16 """退出程序的回调函数"""
17 icon.stop() # 停止托盘图标
18 print("Exiting program...")
19 os._exit(0) # 强制退出程序
10 20
11 def run_icon(icon_path): 21 def run_icon(icon_path):
12 image = Image.open(icon_path) # 加载自定义图标 22 """运行系统托盘图标"""
13 icon = pystray.Icon("test_icon", image, "My System Tray Icon") 23 image = load_icon(icon_path)
14 icon.run() 24 if not image:
25 print("Failed to load icon. Exiting...")
26 return
27
28 # 创建系统托盘图标
29 icon = pystray.Icon(
30 name="test_icon",
31 icon=image,
32 title="My System Tray Icon",
33 menu=pystray.Menu(
34 pystray.MenuItem("Exit", on_exit) # 添加右键菜单项
35 )
36 )
37 icon.run() # 运行托盘图标
15 38
16 def start_tray_icon(icon_path): 39 def start_tray_icon(icon_path):
40 """在新线程中启动系统托盘图标"""
17 threading.Thread(target=run_icon, args=(icon_path,), daemon=True).start() 41 threading.Thread(target=run_icon, args=(icon_path,), daemon=True).start()
...\ No newline at end of file ...\ No newline at end of file
......
1 # -*- mode: python ; coding: utf-8 -*-
2
3
4 a = Analysis(
5 ['we.py'],
6 pathex=[],
7 binaries=[],
8 datas=[('data', 'data')],
9 hiddenimports=[],
10 hookspath=[],
11 hooksconfig={},
12 runtime_hooks=[],
13 excludes=[],
14 noarchive=False,
15 optimize=0,
16 )
17 pyz = PYZ(a.pure)
18
19 exe = EXE(
20 pyz,
21 a.scripts,
22 a.binaries,
23 a.datas,
24 [],
25 name='we',
26 debug=False,
27 bootloader_ignore_signals=False,
28 strip=False,
29 upx=True,
30 upx_exclude=[],
31 runtime_tmpdir=None,
32 console=False,
33 disable_windowed_traceback=False,
34 argv_emulation=False,
35 target_arch=None,
36 codesign_identity=None,
37 entitlements_file=None,
38 icon=['data\\app.ico'],
39 )
This diff is collapsed. Click to expand it.
1 # -*- mode: python ; coding: utf-8 -*-
2
3
4 a = Analysis(
5 ['we1.py'],
6 pathex=[],
7 binaries=[],
8 datas=[('data', 'data')],
9 hiddenimports=[],
10 hookspath=[],
11 hooksconfig={},
12 runtime_hooks=[],
13 excludes=[],
14 noarchive=False,
15 optimize=0,
16 )
17 pyz = PYZ(a.pure)
18
19 exe = EXE(
20 pyz,
21 a.scripts,
22 a.binaries,
23 a.datas,
24 [],
25 name='we1',
26 debug=False,
27 bootloader_ignore_signals=False,
28 strip=False,
29 upx=True,
30 upx_exclude=[],
31 runtime_tmpdir=None,
32 console=True,
33 disable_windowed_traceback=False,
34 argv_emulation=False,
35 target_arch=None,
36 codesign_identity=None,
37 entitlements_file=None,
38 icon=['data\\app.ico'],
39 )
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!