Python script packaged as .exe file

Recently I wrote a small program that needs to be packaged exe, for simplicity, the direct use of the pyinstaller this module, for python3.6 version of children's shoes, it is simply not convenient. Here we'll tell you about how to wrapper with pyinstaller for the exe program.

First, you need to install this application pip look, this has been said in previous articles, please learn from windows and linux have windows and linux.

The second step, after installed pip, pip install pyinstaller enter cmd in the command window that can install on pyinstaller, then the next step is to introduce a few instructions on pyinstaller:
-w command
directly issued exe applications with command line debugger window , was added in the instruction command can -w shield;
-F command
attention command is case-sensitive. Here it is capitalized. -F instruction files can be packaged into a separate application exe file, or a tape and various dependency dll file folder;
-p instruction
This instruction may be added later pyinstaller path search module. Because many modules packaged applications involved. Here you can add your own path. But after I tested, are under the directory site-packages can be identified, it does not need to be added manually.
So usually use -F command syntax is: pyinstaller -F (python program name) .py
to "helloword" A Case Study

Under a new folder to python program into them, and then click the blank space, hold down the shift + right click, click on "Open command window here", enter "pyinstaller -F hello.py" in cmd command

After Enter, the following screen will appear

These certifications have a good package exe program, and in the new folder, the following files will appear

Exe program packaged in the dist folder, as shown:

If your windows is genuine, then there will be the words "hello world", if not there will be no genuine dll file support, you need to be genuine system installed.

Reprinted from: https: //blog.csdn.net/qq_32113189/article/details/83109566 
 

Guess you like

Origin blog.csdn.net/guyan1101/article/details/93738387