Python program packaged as EXE (using Pyinstaller)

Source: Internet
Author: User

pyinstaller:https://github.com/pyinstaller/pyinstaller/

(This file can automatically install dependencies, other versions seem to install dependencies themselves)

Unzip to a folder after download, 1 is the extracted file

Figure 1-Pyinstaller folder after decompression

The setup.py file will be seen in the folder after the decompression is complete.

Enter file directory from cmd, "

Install setup.py

will prompt to load ... The dependent files Pywin32 and pywin32 dependent files are automatically downloaded in the case of automatic networking ...

Finally, the installation is successful, this time can be used ...

D:\pyinstaller\pyinstaller-develop>python pyinstaller.py--console--onefile  wdf.py

D:\pyinstaller\pyinstaller-develop is the Pyinstaller file directory to enter

wdf.py is the file I want to pack, just put it in the same folder in pyinstaller.py.

After the run is complete, a WDF folder appears in the current folder

The above compiled EXE can run normally, but with a black console, the following recompile, add--windowed--icon, cancel--console

D:\pyinstaller\pyinstaller-develop>python pyinstaller.py-  w  --onefile--icon="My.ico  " wdf.py  

Icon is a file of icons, PY is the program to be packaged. Finally generate a wdf.exe executable file, click Wdf.exe to display the drawing.

Python program packaged as EXE (using Pyinstaller)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.