How to write win programs in python

Python can write win programs. The format of win program is exe, let's take a look at the method of writing exe program using python.

After the python program is written, the py2exe module can be packaged as an exe program.

Actual operation process:

1、 Create a file in the same directory of app.py, add, delete, or modify the content of setup.py as needed,

# setup.py
import sys, os
from cx_Freeze import setup, Executable
 
__ version__ ="1.1.0"
 
# include_files =['logging.ini','config.ini','running.png']
include_files =[]
excludes =["tkinter"]
# packages =["os","idna","requests","json","base64","pyodbc"]
packages =["os","idna","requests","json","base64"]setup(
 name ="appname",
 description='App Description',
 version=__version__,
 options ={"build_exe":{'packages': packages,'include_files': include_files,'excludes': excludes,'include_msvcr': True,}},
executables =[Executable("boxLayout.py",base="Win32GUI")])

2、 Excuting an order

python setup.py bdist_msi

Then generate two folders, build and dist

Find the generated exe file in build\exe.win32-3.6

Content supplement:

Use Python to develop windows desktop programs

Preparation for development

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

A wxWidges integrated development environment, as simple as Delphi, can directly drag and drop controls, and is different from other integrated environments. #It does not conflict with the MainLoop of the integrated development environment. Pythonwin and pyScripter will conflict. The typical error is to run the second time #Program time, directly lead to integrated development### 1. Pre-development preparation

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

A wxWidges integrated development environment, as simple as Delphi, can directly drag and drop controls, and is different from other integrated environments. #It does not conflict with the MainLoop of the integrated development environment. Pythonwin and pyScripter will conflict. The typical error is to run the second time #Program, it directly leads to the forced exit of the integrated development environment, because the MainLoop conflicts

  1. wxPython2.8-win32-unicode-2.8.10.1-py26.exe

wxPython library, provides windows component library wx written in C++

  1. py2exe-0.6.9.win32-py2.6.exe

Package release tool, directly package windows program or console program written in python into exe executable file for users to use

The above three softwares are all based on python2.6, the software version must be matched, because their default installation path is related to the python version, otherwise the relevant library will not be found.

So far, this article on how to write win programs in python is introduced. For more related python can write win programs, please search for ZaLou.Cn's previous articles or continue to browse the related articles below. Hope you will support ZaLou more in the future. Cn!

Recommended Posts

How to write win programs in python
How to write classes in python
How to write return in python
How to write try statement in python
Teach you how to write games in python
How to write a confession program in python
How to write python configuration file
How to wrap in python code
How to omit parentheses in Python
How to filter numbers in python
How to read Excel in Python
How to view errors in python
How to understand variables in Python
How to clear variables in python
How to use SQLite in Python
How to use and and or in Python
How to delete cache files in python
How to introduce third-party modules in Python
How to represent null values in python
How to save text files in python
How to run id function in python
How to install third-party modules in Python
How to custom catch errors in python
How to define private attributes in Python
How to add custom modules in Python
How to understand global variables in Python
How to view installed modules in python
How to open python in different systems
How to sort a dictionary in python
How to add background music in python
How to represent relative path in python
Write gui in python
How to use the round function in python
How to use the zip function in Python
How to program based on interfaces in Python
How to install python in ubuntu server environment
How to simulate gravity in a Python game
How to use the format function in python
How to open the ubuntu system in win10
How to use code running assistant in python
How to set code auto prompt in python
How to delete files and directories in python
How to install the downloaded module in python
How to read and write files with Python
How to perform continuous multiplication calculation in python
How to comment python code
How to write Pythonic code
How to learn python quickly
How to uninstall python plugin
How to understand the introduction of packages in Python
How to understand a list of numbers in python
Example of how to automatically download pictures in python
How to save IE as an attachment in python
How to understand python objects
How to use python tuples
How to create a Python virtual environment in Ubuntu 14.04
How to control the ubuntu system in win10 through ssh
How to find the area of a circle in python
Do you still know how to draw cakes in python? ? ?
How to install Helm in Ubuntu
python how to view webpage code