How to package python3 into an exe

Updated on technology 2024-03-20
8 answers
  1. Anonymous users2024-02-07

    First of all, Python is an interpretive line language, and it is not possible to directly generate an executable file.

    Second, if you have to generate an executable file, you need to use tools and packages to do it. Generally we use mods

    It's py2exe this tool.

    You can package a python script and an interpreter together into a binary file.

    Steps: 1 Go to the official website of py2exe program, pay attention to the corresponding python version, for example, the python version used, then adapt to the version of py2exe software.

    2 Put the python script you want to convert into the python folder.

    In the python directory, it is usually (c: python27, depending on where you installed python) to create a file, and enter the following **:

    from import setup

    import py2exe

    setup(console=["The name of the file that will be converted. py"])3 Go to the python27 directory from the terminal (cmd) and enter the following command:

    python py2exe

    This completes the from. py file to .Conversion of exe file.

    The generated software is in the dist folder.

  2. Anonymous users2024-02-06

    1. Check the python version on your computer.

    2.**32-bit pyqt4, installed in the default directory, after successful installation, a pyqt4 folder will appear under c: python34 lib site-packages.

    3.After successful installation, unzip the good cx, and then copy the three files inside to c: python34 lib site-packages.

    4.Try whether the above installation is successful in the test sample of CX Freeze, copy the directory to cmd, and then run the operation.

    5.After running, add a build folder that contains the exe files we want.

    6.If the following white window appears when you double-click the file, the software is installed successfully and the exe file can be successfully packaged.

    7.If you want to run the exe software on someone else's computer, you only need to copy all the files in this directory to the other person's computer.

  3. Anonymous users2024-02-05

    Some people say that py2exe is too old, lacks maintenance, and is inconvenient to operate, so the pyinstaller project is recommended.

    You can pack it with a single command:

    pyinstaller -f -w -i

    f: Packaged as a single file.

    w: Windows program, does not display the command line window.

    i: It's the program icon, and it's the py file you want to pack.

    Also requires pywin32.

    Installation method: Run pip install pywin32 and then pip install pyinstaller, how simple.

  4. Anonymous users2024-02-04

    1. To install pywin32, you can refer to "How to install pywin32 module for python?" Xiangdong must pay attention to the corresponding python version, otherwise it cannot be installed.

    2. Use the command line to call pip to install pyinstaller.

    3. Prepare a py file, a python file to crawl e-books——。

    4. Prepare a**, as the icon of the exe:, note that the ** format is ICO, the size is 32*32, not too big. If not, you can convert the format online for free. Put sum into a directory - C: A

    5. Switch the current directory of cmd to c: a.

    6. Then run the command line: pyinstaller -f -i

    7. After running, cmd becomes like this.

    8. In the C: A directory, there are a few more folders. The executable file is located in the dist folder.

    9. Double-click on the executable file, and a command prompt port will pop up, prompting you to enter the book number. Enter the book number according to the format, click the enter key, and you can see the e-book of a chapter in the dist folder.

  5. Anonymous users2024-02-03

    2.Use.

    Python uses pyinstaller to make an executable --- executable

    There are three options for Python to generate executable programs in the EXE format under Windows: py2exe is well-known, and today we will introduce pyinstaller, a tool available on all platforms. I used Python to make a tool program for my colleagues in the company to use, because the company uses a lot of Mac Linux Windows, I used it to make the program into an executable file, good compatibility, but it will make the program start slower on the Linux platform and Mac platform (Windows is still relatively fast), but it is basically enough.

    Once you've installed pyinstaller, you're ready to go.

    1.Methods for generating executable files using pyinstaller.

    Centralize dependencies into one folder:

    pyinstaller -d -w and replace it with your main entry python file.

    The w parameter represents a form program.

    Package all dependencies into the same executable:

    pyinstaller -f -w

    2.Investigate the loading process of the pyinstaller generator.

    Use the following command to get the runtime trace, tracing, and loader loading process.

    pyinstaller -fwd replaces the file you need to detect.

  6. Anonymous users2024-02-02

    1. Install pyinstaller

    2) Unzip the file: [d: ;

    3) Enter the folder in the command prompt and enter the command: python install

    Or: enter pip install pyinstaller in the command prompt

    4) Enter the command: pip list, you can view all the installed packages and versions of python;

    2. Package the py file into an exe file.

    1) Create a new folder [myexe] in the [d: directory] and put the py file into it;

    2) Command prompt into the myexe folder;

    3) Command prompt input: pyinstaller -f filename. py;Pay attention to spaces and capitalization; [e.g. pyinstaller -f.]

    4) Several files will be generated inside the folder, where the exe file is in the dist folder.

    3. Other parameters: Enter the command pyinstaller -h to view.

    4. Tried commands:

    1) [pyinstaller -w, generate exe file when running, will not pop up cmd window;

    2) [pyinstaller --icon=d: f, which can generate icons for the exe file.]

  7. Anonymous users2024-02-01

    There are three options for Python to generate executable programs in the EXE format under Windows: py2exe is well-known, and today we will introduce pyinstaller, a tool available on all platforms. I used Python to make a tool program for my colleagues in the company to use, because the company uses a lot of Mac Linux Windows, I used it to make the program into an executable file, good compatibility, but it will make the program start slower on the Linux platform and Mac platform (Windows is still relatively fast), but it is basically enough.

    Once you've installed pyinstaller, you're ready to go.

    1.Methods for generating executable files using pyinstaller.

    Centralize dependencies into one folder:

    pyinstaller -d -w and replace it with your main entry python file.

    The w parameter represents a form program.

    Package all dependencies into the same executable:

    pyinstaller -f -w

    2.Investigate the loading process of the pyinstaller generator.

    Use the following command to get the runtime trace, tracing, and loader loading process.

    pyinstaller -fwd replaces the file you need to detect.

  8. Anonymous users2024-01-31

    There are three options for Python to generate executable programs in the EXE format under Windows: py2exe is well-known, and today we will introduce pyinstaller, a tool available on all platforms. I used Python to make a tool program for my colleagues in the company to use, because the company uses a lot of Mac Linux Windows, I used it to make the program into an executable file, good compatibility, but it will make the program start slower on the Linux platform and Mac platform (Windows is still relatively fast), but it is basically enough.

    Once you've installed pyinstaller, you're ready to go.

    1.Methods for generating executable files using pyinstaller.

    Centralize dependencies into one folder:

    pyinstaller -d -w and replace it with your main entry python file.

    The w parameter represents a form program.

    Package all dependencies into the same executable:

    pyinstaller -f -w

    2.Investigate the loading process of the pyinstaller generator.

    Use the following command to get the runtime trace, tracing, and loader loading process.

    pyinstaller -fwd replaces the file you need to detect.

Related questions
12 answers2024-03-20

Python is an object-oriented interpreted language, and object-orientation is a very important feature. "Object-Oriented Programming in Python 3" shows the concepts and principles of object-oriented in Python through the data structure, syntax, and design patterns of Python, from simple to complex, from elementary to advanced, step by step.

29 answers2024-03-20

The landlord is very funny.

1, the Terrans do not divide the mines when they can divide the mines, unless the other party is a rookie, or the Terrans will lose. >>>More

6 answers2024-03-20

Not only can the solidified mud on the earth sand dragon improve its defense, but it will also splash mud as a means of attack, and it is best to attack with the water attribute ** and projector it is afraid of, and the mud will be peeled off first, so as to be in an advantageous position when dealing with it. >>>More

7 answers2024-03-20

In fact, the computer is difficult to say, it's not difficult to say it's not difficult, LZ If it's an alliance vs an alliance, then it's best to fight, the combination of javelinmen + frozen + guardian, if you have more money, you can also come out of Phantom and Athena, in fact, the money is not particularly small in Red Alert 3, the main thing is to occupy more mines in the early stage. >>>More

13 answers2024-03-20

How to use OTG:

1. Turn on the OTG function >>>More