Python·pyinstaller package to generate a dependency-free EXE

The pyinstaller module is used to package and publish python projects into exe files for easy running on machines without a python environment installed. The module can be installed using  pip install pyinstaller  .

1. Common parameters and meanings

 2. Packaging simple py files

For a simple .py file, when there are no .py files in other paths with dependencies, other packages without indirect dependencies, and resource files without dependencies, the command pyinstaller –F xxx.py can be used to directly package it into an exe file.

Example: a simple integer summation applet

Name calculator.py, write the content

if __name__ == '__main__':
    print("求和小程序")
    a = input("请输入第一个数:")
    b = input("请输入第二个数:")
    print()
    c = int(a) + int(b)
    print("两数之和为:",

Guess you like

Origin blog.csdn.net/qq_37865996/article/details/124306587