|
|
|
|
|
by memracom
3218 days ago
|
|
You could take a look at a small project that I did a few years ago to create a portable CPython build for Linux. https://github.com/wavetossed/pybuild
The basic idea was to make a CPython binary that did not use any system libraries. Instead, all dynamic linking was to local files within the directory tree of the application. That way you could zip up (or tar up) a directory tree containing this portable Python, its binary libraries and any Python modules/libraries that you needed. The result was a self=contained app that could be copied to any Linux server, unpacked and executed. No prerequisites on the server except a new enough Linux kernel because the Linux ABI changed at some point around 10 years ago or so. By updating the build script in the Github repo, you could update this to a newer version of Python 3. To make a Windows binary doing the same thing would require a reasonable amount of knowledge about object files, linking, and Windows DLLs. It might be easier to use the MINGW GCC compiler rather than Microsoft, so consider that possibility. First thing to do is to understand how the CPython binary on Windows works and loads DLLs before actually executing Python code. The key is to intercept this process so that you have total control over all object files and do not rely on anything else being preinstalled on the target system. |
|