The server does not have a python environment installed and cannot directly execute python scripts, how can python be packaged into an exe application? Run directly on top of the Windows server.
First, install the python environment on the development computer, and then install the pyinstaller package.
PyInstaller is a tool for packaging Python programs into a standalone executable package for Windows, Linux, and Mac OS X.
PyInstaller can read the Python scripts you write. It analyzes your code to discover all the other modules and libraries required for script execution. It will then collect copies of all these files - including the active Python interpreter! - and put it in a single folder with the script, or optionally in a single executable.
PyInstaller has been tested for Windows, Mac OS X, and GNU/Linux. However, it is not a cross-compiler: to make a Windows application, run PyInstaller in Windows. To create a GNU / Linux application, run it in an environment such as GNU / Linux. PyInstaller has been successfully used with AIX, Solaris, FreeBSD, and OpenBSD, but has not been tested against them in continuous integration testing. The command is as follows:
Switch to the packager directory and package it with the following command:
After the packaging is successful, add a dist folder to the project, which contains the packaged exe application.
|