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

编程入门 行业动态 更新时间:2024-10-24 20:20:32
本文介绍了Python,Pyinstaller 在 Windows 中创建快捷方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在制作一个使用 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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 06:53:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1390786.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:快捷方式   Python   Pyinstaller   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!