Windows environment, Python packaging window program Windows environment, Python packaging command line program Windows environment, Python packaging command line program

Source: Internet
Author: User


This article describes how to use python to generate executable windows.ProgramAnd port it to other environments without python.



The previous article briefly introduced how to package the command line program: Windows environment, Python package the command line program.



The program list is as follows:



E: \ projects_python \ simplewindow \ window. pyw (source program)


 



 
# window.pyw import wx

app = wx.App()
win = wx.Frame(None)
win.Show()
app.MainLoop()


Note: If the extension of the same file is py, a command line window will appear at startup, which is quite uncomfortable. If it is changed to pyw, the command line window will no longer appear.



E: \ projects_python \ simplewindow \ setup. py (installation script)


 
 
import py2exe
from distutils.core import setup
#setup(windows=["E://projects_python//simplewindow//window.pyw"]) // If such a simple script is not enough, an error will be reported: msvcp90.dll is missing. Because the window program uses msvcp90.dll.
setup(
    options = {
      "py2exe": {
        "dll_excludes": ["MSVCP90.dll"],
      }
    },
    windows=[{"script": "E://projects_python//simplewindow//window.pyw"}]
)


The installation process is the same as that of the Windows environment.



In the same example, the simplewindow.exe directory will generate a distdirectory with the same name as window. pyw. This is an executable program.


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.