问题
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!
回答1:
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.
来源:https://stackoverflow.com/questions/6673041/python-pyinstaller-creating-shortcuts-in-windows