Some time ago want to learn the crawler, through the BT search engine to find the film's magnetic chain, but the first step is stuck, the general crawler is based on certain rules, crawling site existing content (mostly articles, pictures). If it is crawling search engine, usually also have? Search=xxx such an address is available for use
But this BT site, post-redirect, the directory structure is a string of random strings, a moment without finding a solution, on hold.
Today just learn to turn the py into EXE, because a lot of customer servers, if you write a py script, to each server to deploy a Python environment, too cumbersome.
1, download Pyinstaller, official website www.pyinstaller.org, standard version cannot download (with VPN also not), development version can download
2, download zip decompression, but found that in fact, you can use Pip directly (i deleted the download zip)
Pip Install Pyinstaller
3. To the directory where the. Py is located, use Pyinstaller
Pyinstaller yourprogram.py
4. Error: Failed to create process
Because my Python is in program Files (x86), there are spaces in the folder that are not recognized
D:\Program Files (x86) \python27\scripts
To that directory, find pyinstaller-script.py, edit, and double-quote the first line of the TOC
Or simply reload python into a folder without spaces.
5, the default packaging EXE finished, will generate a Dist folder in the current directory, a lot of files
6, using the-f parameter, can be packaged into a file, look good, such as Pyinstaller-f xxx.py
7, on the simplest of Hello world, also want 3665KB, but also does not matter, can use on the line. Normal operation of the machine
8, put on the customer Win2003 run, reported that "the image file is valid, but not for this computer type", is searching for reasons
Python Learning 8th day pack exe