Python program to windows .dll - python

I am trying to convert python code in to .dll for windows.
I have tried pyinstaller but it gives directly the .exe whereas i would need .dll.
Is there any method by which i can convert the python script to .dll (not .pyd) ?

Related

How to convert a python script .py file into an exe without embedding python interpreter in it

My requirement is to deploy a python script in a form of exe with digital signature but the python interpreter and dependent python modules should not be embedded into the exe. Rather, python needs to be explicitly installed on the server.
I have tried pyinstaller and cx_freeze but both embeds python and related modules along with the script codebase into the exe. We need to decouple python and script codebase.
You can use py2exe and use Cython to convert your key .py files in .pyc, C compiled files, like .dll in Windows and .so on Linux.
Alternatively, you can use PyInstaller to package Python programs as standalone executables. It works on Windows, Linux, and Mac.

PyInstaller: Can't find .so module when exe is executed

A python script uses a .so file.
I made an exe for this python script using PyInstaller.
But when I execute the generated exe, it is unable to locate this .so file
So how to link this .so to a python code that will get converted to a .exe
Note: when running the .py program, if I set the location of .so in LD_LIBRARY_PATH, it executes the program correctly but once I make the exe using
pyinstaller script.py --onefile
(with .so in the same directory), it doesnt find the .so file..
Thank you in advance
You need to make sure that your . so file is in your system library path as well as your python library path. Setting your LD path is a quick fix. PyInstaller will need it in your system path. Depending on your Windows version it's Environment variables>PATH.

How do I make an exe file from a python code under Ubuntu?

I'm using Ubuntu 16 64-bit and python 3.5
I made a program on python and I want to distribute it as an EXE for Windows users.
The program I made depends on pandas and matplotlib
I downloaded PyInstaller.tar.gz and extracted it, but I can't find any clear info on how to make make an EXE.
I tried
python ../PyInstaller/pyinstaller.py --onefile ../Project/program.py
But it creates a sub folder with a lot of files and none of them are exe

python GUI to EXE with image and modules

I have created a Python GUI and trying to convert it to .exe with py2exe.
i am using following modules wx,matplotlib,numpy,time,serial,random and a .ico image as logo.
i tried create a setup.py file but it didn't work.need help creating setup file to generate .exe of my GUI.
It would be convenient if you could provide some details regarding why the .EXE is not being created. If you can't provide the details then please go through these questions on Stackoverflow, they maybe helpful:
How to build a python package into an exe
Making a standalone .exe file of a python script
Compiling python code into a single exe
Convert Python Script to .exe that will work on all/most versions of Windows
The best thing is to first refer to the official documentation!

Do I need Python installed if I have PYC files?

I want to add Python as a scripting language to my game. If instead of distributing PY script, I distribute the PYC compiled files with my game, will the user still need Python installed, or will the DLL be sufficient?
Not only would they still need the Python interpreter, but the compiled python byte-code files are not guaranteed to work across different platforms.
You do need an executable to actually load the files into the VM. Fortunately it doesn't need to be very complex.
pyinstaller can be used to convert the .py file into an executable file
to install the pyinstaller
pip install pyinstaller
and to convert the .py file let's say file.py
pyinstaller file.py
this will make two new folders in the same directory
build and dist. dist folder contains all the required dll and file.exe to run the python code without python installed.

Categories