Python、Pyinstaller 在 Windows 中创建快捷方式

发布于 2024-11-19 12:44:22 字数 586 浏览 7 评论 0原文

我正在制作一个 python 脚本,使用 win32com.client 模块创建快捷方式 (.lnk) 文件,我正在使用 pyinstaller 来转换它执行。我也在使用 Tkinter,因此我需要 pyinstaller 中的 --tk 支持。 Pyinstaller 似乎无法与 --tk 一起使用并同时导入 win32com.client (我不知道为什么)我需要这个工作。也许有一种方法可以在没有 win32com.client 的情况下创建快捷方式(我搜索了很多但没有成功)或让 pyinstaller 工作(我发现 win32com 之间存在问题.clientpyinstaller 这里,但补丁没有解决我的问题)谢谢!

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

他不在意 2024-11-26 12:44:22

如果有人感兴趣,我找到了一种创建快捷方式的方法使用win32com.shell 而不是 win32.client
这与 pyinstaller--tk 标志设置为 ON 配合良好。

If anyone is interested, I found a way of creating shortcuts using win32com.shell rather than win32.client.
This works well with pyinstaller and --tk flag set to ON.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文