Python- Compiling a .py program with .exe dependencies

Viewed 172

I have written a Python (v3.8.1) Python program which relies on a c compiled .exe program. The Python script itself works as expected and I am ready to package it for use within Windows, in environments where Python is not installed.

I want to wrap both programs together under one .exe if possible and practical.

Based on a comment, I have gone through the compiling process with Pyinstaller using the following commands:

pyinstaller myprogram.py --hidden-import notional_library --add-data 
compiled_c_program.exe;. --add-data dependency.COF;. -w -D

And the program works perfectly. However, when I change -D to -F to create a onefile.exe, the program breaks along the lines of the compiled c program, which is confirmed when I debug the program.

I have also tried adding the c program as a binary, but that does not work either.

Placing the dependencies in the same folder does work, and is an amenable solution, but I would still prefer to wrap both programs into a single executable if possible.

0 Answers
Related