Python、Pyinstaller 在 Windows 中创建快捷方式
我正在制作一个 python 脚本,使用 win32com.client
模块创建快捷方式 (.lnk
) 文件,我正在使用 pyinstaller
来转换它执行。我也在使用 Tkinter
,因此我需要 pyinstaller
中的 --tk
支持。 Pyinstaller
似乎无法与 --tk
一起使用并同时导入 win32com.client
(我不知道为什么)我需要这个工作。也许有一种方法可以在没有 win32com.client
的情况下创建快捷方式(我搜索了很多但没有成功)或让 pyinstaller
工作(我发现 win32com 之间存在问题.client
和 pyinstaller
这里,但补丁没有解决我的问题)谢谢!
I am making a python script that creates a shortcut (.lnk
) file, using win32com.client
module, I am using pyinstaller
to convert it to exe. I'm also using Tkinter
, so I need --tk
support in pyinstaller
. Pyinstaller
doesn't seem to work with --tk
and import win32com.client
at the same time (I have no idea why) I need this to work. Maybe there's a way to create shortcuts without win32com.client
(I've searched a lot without success) or to make pyinstaller
work (I foud an issue between win32com.client
and pyinstaller
here , but the patch did't solved my problem) Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果有人感兴趣,我找到了一种创建快捷方式的方法使用
win32com.shell
而不是win32.client
。这与
pyinstaller
和--tk
标志设置为ON
配合良好。If anyone is interested, I found a way of creating shortcuts using
win32com.shell
rather thanwin32.client
.This works well with
pyinstaller
and--tk
flag set toON
.