Run the program with the Py2exe package script as a double-click under Windows

Source: Internet
Author: User

Folder structure:

├──readme.txt

├──settings.py # program Parameters

├──settings.pyc

├──setup.py # installation files

├──spider.ico #windows under the program icon, Mac for. Icon

└──spider_am.py #主程序

setup.py:

#!/usr/bin/env python#! _*_ coding:utf-8 _*_from distutils.core import setupimport py2exeimport syssys.argv.append (' Py2exe ')   # Double-click to run Py2exe _options = {        # "dll_excludes": ["MSVCP90.dll",],        "Compressed": 1,        "optimize": 2,        "ASCII": 0,        # " Bundle_files ": 1, #64位机器上这句不用写        }setup (      name = ' crawler ',      Version = ' 1.0 ',      console = [{' script ': ' Spider_ am.py ', ' icon_resources ': [(0, ' Spider.ico ')]}], # Script & icon      zipfile = None,      options = {' Py2exe ': py2exe_ Options}      )

Command line:

Original command: Python setup.py py2exe because the lxml third-party library in the main program is packaged so: Eventually the package command becomes: Python setup.py py2exe-p Lxml,gzip succeeded

There are two more folders in the last folder:

The program is in the Dist folder.

Run the program with the Py2exe package script as a double-click under Windows

Related Article

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.