Developing a Windows desktop program using Python

Source: Internet
Author: User

First, the preparation of early development

1. Boa-constructor-0.6.1.bin.setup.exe

#一个wxWidges的集成开发环境, Simple as Delphi, you can drag and drop the control directly, and other integration environment, #它不与集成开发环境的MainLoop冲突, with Pythonwin,pyscripter will conflict, the typical error is to run the second time #程序的时候, which leads directly to the forced exit of the integrated development environment because mainloop conflicts

2. Wxpython2.8-win32-unicode-2.8.10.1-py26.exe

#wxPython库, provides a Windows component library, written in C + + WX

3. Py2exe-0.6.9.win32-py2.6.exe

#打包发布工具, a python-written Windows program or console program is packaged directly into an EXE executable file for use by users

The above three software is based on python2.6, the software version must be matched, because their default installation path and Python version has a relationship, otherwise will not find the existence of the relevant library.

Second, the development

After the software installation, open boa, wow, drag the control is really simple, and the properties of what is similar to Dephi, you just change the properties, the code will be automatically generated, it generated the control is very beautiful, remember the previous use

c++6.0 development software, the control is really ugly, I need to re-use the control library to bind the optimization, now no, Boa generated control, visual effect is quite good, the development of software quickly, and then

Not to write too much code for the software interface, nor to generate a lot of files to generate a small program, a python-developed program, no redundant files, and very small files.

Third, the release

Many people want to write in their own software program, post to other people to use, on the one hand do not want their code leaks, on the one hand to show a sense of accomplishment, hehe, you can use Py2exe will your

Windows programs are packaged and released! Of course, first you have to write a setup.py file as follows:

From Distutils.core Import Setup  import py2exe includes = ["Encodings", "encodings.*"] options = {"Py2exe":             {
  
    "Compressed": 1,                 "optimize": 2,                 "includes": Includes,                 "Bundle_files": 1             }           } setup (     version = "0.1.0",     description = "Windows program",     name = "Winsetup",     options = options,     zipfile=none,     windows=[{"script": "myscript.py", "Icon_resources": [(1, "Pycrust.ico")]}],  )
  

You can run under the command line: Python setup.py py2exe, then you will find your application appears in the Dist folder, congratulations, completed the development of Windows application!

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.