MOOC Python Language Programming (Week 5) 3 PyInstaller Modules

PyInstaller module

    Convert the .py source code into an executable file without source code, and the packaged exe file does not need any python environment to execute on other computers

    

    is a third-party library, http:pyinstall.org 

    Requires pip installation: pip install pyinstaller


    use

            (cmd command line) First switch to the directory of the .py file, and then enter the command: pyinstaller -F <filename.py>

            


        Generated folder:

            

               The dist folder is the packaged exe executable file with the same name as the source file, bulid and _pycache_ are temporary files that can be deleted

               

  Common parameters:

        -h see help

       --clean clean up temporary files during packaging

        -D, --onedir default value, generate dist folder, the files in this folder are required for execution

        -F , --onefile only generates independent package files in the dist folder (that is, the exe file under the windows platform) It is recommended to use

        -i <icon filename.ico> Specifies the icon file used by the packager

        

        

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327012861&siteId=291194637