问题描述
限时送ChatGPT账号..我正在制作一个使用 win32com.client
模块创建快捷方式 (.lnk
) 文件的 python 脚本,我正在使用 pyinstaller
将其转换为exe.我也在使用 Tkinter
,所以我需要 --tk
在 pyinstaller
中的支持.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!
推荐答案
如果有人感兴趣,我找到了一种使用 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
.
这篇关于Python,Pyinstaller 在 Windows 中创建快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论