Home  >  Article  >  Backend Development  >  Can python develop exe software?

Can python develop exe software?

(*-*)浩
(*-*)浩Original
2019-07-06 11:17:005991browse

pyinstaller packages Python scripts into exe software so that they can be run on machines without a Python environment

Can python develop exe software?

# #The latest version is pyinstaller 3.1.1. Supports python2.7 and python3.3. Can run under Windows, Mac and Linux operating systems. (Recommended learning: Python video tutorial)

But it is not cross-compiled, which means that the exe generated by PyInstaller under Windows can only run under Windows, and under Linux The ones generated under can only run under Linux.

Installation of pyinstaller under windows

Use the command pip install pyinstaller. Under windows, pyinstaller requires the support of PyWin32. When PyWin32 is not found when using pip to install pyinstaller, pypiwin32 will be installed automatically

Successfully installed pyinstaller-3.1.1 pypiwin32-219 appears, which means the installation is successful

Use

Locate the folder where pyinstaller.exe is located (usually under the "scripts" folder under python) (warm reminder: Press the tab key on cmd to complete the function)

Then Add the address of the file you want to convert (there is a space between the two)

If -F is added after pyinstaller.exe, it will be packaged into an exe file (the file will be larger), if not added There will be a lot of library files; adding -w will package it into an exe without a cmd window. If you don't add it, the cmd window will appear when running. (Add or not depends on personal preference)

-F command

Note that commands are case-sensitive. It's capitalized here. Use the -F command to package the application into an independent exe file, otherwise it is a folder with various dlls and dependent files

-p command

This After the instruction, you can add the path for pyinstaller to search for modules. Because application packaging involves many modules. You can add the path yourself here. However, after testing by the author, it can be recognized in the site-packages directory, and there is no need to manually add

For more Python-related technical articles, please visit the

Python Tutorial column to learn!

The above is the detailed content of Can python develop exe software?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn