Python Environment 2.7.4
The final effect is as follows
Using the Pyinstaller
It takes two steps to pack an EXE here
First step
Command line direct pip install Pyinstaller in a Python environment
Second Step
When the download is complete,
Command line
Pyinstaller-f file name
You can generate EXE files, files in general c/user/your username/dist/under
If you want to modify the icon, just
pyinstaller-f filename-I icon name, example below
Note that here-F must be capitalized, I must be lowercase
In addition, the command-line encoding is GBK, and the Py script will be entered in Chinese, which is usually set to Utf-8, i.e.
#coding =utf-8
Therefore, the output of the command line will be garbled, there are two solutions, one is to change the command line to UTF-8 format
One is to add after the output
. Decode ('utf-8 '). Encode (' GBK ')
Such as:
"Delete Complete". Decode ('utf-8 '). Encode (' GBK ')
(sql_name_alter+ "Add new column"+column_name+"Success"). Decode (' Utf-8 '). Encode (' GBK ')