简体   繁体   中英

How to create a desktop shortcut from a compressed file

Recently I have been approached by friends and family asking me to create various python apps for them. I'm trying to find an easy way to distribute these projects in a way that requires zero prior knowledge and minimal explanation.

My idea is to create a virtual environment for each app and compress it, then I can simply email it to them, they can unzip it and be good to go. My question is how can I have this create shortcuts on their desktops to things such as the batch file (most importantly), excel sheets, image folders, etc?

I would appreciate any help on this, or if I'm going about this completely wrong, it would be great to learn of a better way.

What you are taking about is 'freezing' your code so it can be distributed. Here is an overview of the concept http://docs.python-guide.org/en/latest/shipping/freezing/ .

I personally have had the best luck with PyInstaller being able to create a single executable file (ie my_app.exe ) https://pyinstaller.readthedocs.io/en/stable/operating-mode.html

Now that your code is portable, to create the desktop icon there are various installers you can use to package that and anything else you need. http://www.makeuseof.com/tag/how-to-make-an-exe-installation-file/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM