Python Forum
Python/C API project - compile to exe
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python/C API project - compile to exe
#1
Hello

I'm working on project where I am using Python/C API and C++. C++ is used for most part of application, mainly for gui (wxWidgets), while Python is used for calculations on large data sets, e.g. from files. I'm doing it in Visual Studio and when I run the project in IDE everything works fine, like I want it to. Also, the exe file that is created during the launch of the project in the visual studio, when it is in the same folder with the python .py file, also works as it should be. But what I want to achieve is a complete application contained in one exe.

While searching for a solution, I found various possibilities to create an exe from a python file. For example, PyInstaller which I tested for a simple "hello world" python file and it works. However, I don't know and can't find a solution how to combine the exe created in visual with a python file.

In PyInstaller github issues I found that line:
pyinstaller App.py --add-data 'pathtoexe\your.exe;.' --add-binary "pathtodll\your.dll;." --onefile --noconsole --clean
And I typed this into the console:
pyinstaller myPythonFile.py --add-data 'myVisualGeneratedFile.exe;.' --onefile --noconsole --clean
But after that, when I clicked generated exe file, nothing happens.
Next I tried to set exe as binary, something like this:
pyinstaller myPythonFile.py --add-binary 'myVisualGeneratedFile.exe;.' --onefile --clean
But it's the same situation. Nothing.
I hope that someone has done a similar thing before and I can find help here because I'm already losing my mind on it.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to compile a Python script for a Windows / Linux executable? netanelst 2 1,319 May-24-2022, 07:02 AM
Last Post: netanelst
  cv2-python will n ot compile?? barryjo 5 2,189 Dec-26-2021, 06:42 PM
Last Post: barryjo
  Python Compile error ajitnayak1987 4 3,638 Jun-03-2021, 12:11 PM
Last Post: ibreeden
  Embedded python fails to compile on Raspberry Pi tryfon 2 3,471 Dec-22-2020, 02:06 PM
Last Post: tryfon
  How to cross compile python for ARM ? pankaj 4 5,689 Mar-06-2019, 05:59 AM
Last Post: pankaj
  Compile python project to single portable .exe file Campbell 5 10,694 Dec-05-2017, 01:20 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020