当前位置:网站首页>Pyinstaller packages py as an EXE file
Pyinstaller packages py as an EXE file
2022-07-28 15:15:00 【Demon YoY】
0、 Preface
Packaged in this way exe Document has 7 Mega , It's not very professional , The window is still black , But you can change the icon , Must have ico Picture file . It's just very simple , Online search is also this method , See what happens .
1、 install pyinstaller
stay cmd Input in :
pip install pyinstaller
2、pyinstaller pack exe
1、 Enter the first py File directory ;
2、 Input again :
pyinstaller -F
3、 And then py Drag files into it ( Input py The full name of the file can also )
The execution is shown in the figure below :
And then with py The following files appear under the same directory :
exe The document is in dist In the folder 
This icon is the default
3、 It's generating exe Change icon when file
Need to use -i Parameters , At the same time, you need to prepare a ico Format picture
On-line ico Make a website :
ico Picture conversion
Get into py File directory
Input :
pyinstaller -F --icon=
hold .ico Drag the file inside (ico The files must also be in this directory )
Add a space
And then py Drag the file into it
4、pyinstaller command
Finally, pyinstaller Use of commands . Using this command will also give you a headache , But relative to other packaging , This is very convenient .
Let's talk about the parameters of this command first , These parameters must be understood , In order to pack better , Use this command .
-distpath=path_to_executable // This parameter specifies the directory where the generated executable file is stored , That's generated exe Directory of files , If you don't specify , By default, it is stored in your C Disk user document directory , That is to say Administrator Under the table of contents dist Under the folder .
-workpath=path_to_work_files // This parameter specifies the directory where temporary files are stored during compilation , Default store in Administrator Catalog build Under the folder .
-clean // Clean up temporary files at compile time , That is to say build Temporary files under the folder .
-D( Abbreviation ),-onedir( Full name ) // Create a directory containing exe Executable files , There are also many dependent files ( Default options ).
-F( Abbreviation ),-onefile( Full name ) // Generate separate exe file , Not a folder . explain : It's a single exe Execution procedure . Without any other file information .
-c( Abbreviation ),-console,-nowindowed // Using the console , Namely dos The form of window , No interface ( Default )
-w( Abbreviation ),-windowed,-noconsole // Using Windows , No console , Such as : Graphical window program , If you don't specify -w, If it runs, it will bring dos window , If you bring it , The only way to open software is the same as normal .
-i( Abbreviation ),--icon= Icon path // If your program needs to bring good-looking ico Format icons , Then take the icon that needs to be prepared ,ico Format , Then add this parameter , Specify icon path .
-p( Abbreviation ),-path // Some packages that your program depends on , The path of the module , You need to specify the .
-d( Abbreviation ),-debug( Full name ) // Compiled into debug Pattern , Mainly to get the log information in operation , View compilation errors .
-version-file=version_text_file // The parameter is exe Add version information to the file , Version information can be obtained by running pyi-grab_version Plus, you need to get version information exe File path to generate , The generated version information file can be modified as required and used as --version-file Add to To generate the exe In the document
pyinstaller -h To see the parameters
边栏推荐
- shellcode编写(未完)
- JS learning notes 24-28: end
- iframe 标签
- Solution to the problem of high collapse caused by float (including all methods)
- What are the CCSP cloud security design principles
- 听说crmeb多商户增加了种草功能?
- Basic operation implementation of sequence table
- Wonderful frog -- how simple can it be to abandon the float and use the navigation bar set by the elastic box
- 3438. Number system conversion
- How to set some app application icons on the iPhone Apple phone that you don't want others to see? How to hide the app application settings on the mobile desktop so that they can be used normally afte
猜你喜欢

When MySQL uses left join to query tables, the query is slow because the connection conditions are not properly guided

Stack expression

Introduction to mqtt protocol

crmeb pro2.2即将增加的功能都有哪些?

Compilation failure caused by kotlin version upgrade

模板注入总结

crmeb 标准版Window+phpstudy8安装教程(一)

听说crmeb多商户增加了种草功能?

Examples of Pareto optimality and Nash equilibrium

苹果iPhone手机APP应用图标隐藏怎么找回恢复显示在iPhone苹果手机桌面显示被隐藏的应用APP图标到iPhone苹果手机桌面?
随机推荐
When MySQL uses left join to query tables, the query is slow because the connection conditions are not properly guided
charles如何安装并使用
Specific operation process of network security emergency response
Foundation of knowledge atlas (II) - knowledge expression system of knowledge atlas
PHP magic method
3715. Minimum number of exchanges
使用cpolar发布树莓派网页(apache2网页的发布)
Instructions for common symbols in kotlin
Deploy flask on Alibaba cloud server
pyppeteer 遇到的问题
SQL labs detailed problem solving process (less1-less10)
安装mosek,license安装位置查找
Publish raspberry pie web page with cpolar (apache2 installation test)
iPhone苹果手机上一些不想让他人看到的APP应用图标怎么设置手机桌面上的APP应用设置隐藏不让显示在手机桌面隐藏后自己可以正常使用的方法?
PHP memory horse
Node.js+express realizes the operation of MySQL database
shellcode编写(未完)
Machine learning related concepts
云计算需要考虑的安全技术列举
JS常用的3种弹出框