1. Download pyinstaller and unzip it (you can go to the official website to download the latest version):
http://nchc.dl.sourceforge.net/project/pyinstaller/2.0/pyinstaller-2.0.zip
2. Download pywin32 and install it (note the version, mine is python2.7):
http://download.csdn.net/download/lanlandechong/4367925
3. Put the project file under the pyinstaller folder (mine is baidu.py):
4. Hold down the shift key and right-click, open a command prompt in the current path, and enter the following (the last is the file name):
Python pyinstaller.py -F baidu.py
5. Double-click the generated exe file in the dist folder under the baidu folder to run: