Original post address
Http://www.newsmth.net/nForum! Article/Python/95829
Completely solve the problem of using cx_Freeze-4.3 on 32-bit Windows 7
PackagePython3.2 + pyqt4.9 is an EXE file.After,
Unable to run in Chinese path, and cannot package file name
YesChinese problems
My environment is:
32-bit Windows 7 + python3.2 + pyqt4.9
Cx_Freeze-4.3
Download the supporting software as follows:
Cx_Freeze-4.3.win32-py3.2.zip attachment (674.6kb)
-----------------------------------------------
Step 1. Install cxfreeze.
Step 2. Modify the file after installation.
Step 3. Install cx_freeze and check whether the installation is correct.
Step 4. Package the file into an EXE file.
Step 5. Check whether the Chinese file name and Chinese path are running normally after packaging.
Tutorial ended
The key to solving the problem lies in the setup. py file. The setup. py file from the Internet may have been written in python2 at the beginning. Of course, it is troublesome to support Chinese characters. So I added the following two statements at the beginning of this file, and thenSaving the setup. py file as UTF-8 encoding solves all Chinese problems.
The added statement is:
#! /Usr/bin/ENV Python
# Coding = UTF-8
I have been searching for a long time on the Internet and have not found any solution. I am very happy to solve this problem through my own efforts. The reason why I sent this tutorial is to leave it to friends who are troubled by this problem, so that they can avoid detours and save more time on programming.
The most difficult problem is the simplest solution.
My note: as the original author said, the core is to set the encoding. However, the author uses UTF-8 in windows, which is quite strange. In fact, I do not know the encoding of the file. In short, this is feasible. Do not forget to open setup. py in notepad and save it as UTF-8 (win gbk by default)