Python Learning 8th day pack exe

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.