Python,Pyinstaller 在 Windows 中创建快捷方式 [英] Python, Pyinstaller creating shortcuts in windows

查看:40
本文介绍了Python,Pyinstaller 在 Windows 中创建快捷方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个使用 win32com.client 模块创建快捷方式 (.lnk) 文件的 python 脚本,我正在使用 pyinstaller将其转换为exe.我也在使用 Tkinter,所以我需要 --tkpyinstaller 中的支持.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!

推荐答案

如果有人感兴趣,我找到了一种使用 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆