Or use PyInstaller as an alternative to py2exe. Here is a good starting point. PyInstaller also lets you create executables for linux and mac...
Here is how one could fairly easily use PyInstaller to solve the issue at hand:
pyinstaller oldlogs.py
From the tool's documentation:
Answer from zenpoy on Stack OverflowPyInstaller analyzes myscript.py and:
- Writes myscript.spec in the same folder as the script.
- Creates a folder build in the same folder as the script if it does not exist.
- Writes some log files and working files in the build folder.
- Creates a folder dist in the same folder as the script if it does not exist.
- Writes the myscript executable folder in the dist folder.
In the dist folder you find the bundled app you distribute to your users.
Or use PyInstaller as an alternative to py2exe. Here is a good starting point. PyInstaller also lets you create executables for linux and mac...
Here is how one could fairly easily use PyInstaller to solve the issue at hand:
pyinstaller oldlogs.py
From the tool's documentation:
PyInstaller analyzes myscript.py and:
- Writes myscript.spec in the same folder as the script.
- Creates a folder build in the same folder as the script if it does not exist.
- Writes some log files and working files in the build folder.
- Creates a folder dist in the same folder as the script if it does not exist.
- Writes the myscript executable folder in the dist folder.
In the dist folder you find the bundled app you distribute to your users.
I recommend PyInstaller, a simple python script can be converted to an exe with the following commands:
utils/Makespec.py [--onefile] oldlogs.py
which creates a yourprogram.spec file which is a configuration for building the final exe. Next command builds the exe from the configuration file:
utils/Build.py oldlogs.spec
More can be found here
linux - How can I get a binary from a .py file - Unix & Linux Stack Exchange
Need to convert a Python script to an executable version in Linux (RHEL). Is there any "Executable" format in Linux like ".exe" in windows? Is it binary ?
Can Python be compiled to binary in any case?
convert python script file to binary in linux operating system - Stack Overflow
In my opinion your problem in Google stems for calling a compiler capable of producing binaries from python a "disassembler".
I have not found a true compiler, however I have found in Google a python compiler packager, which packs all the necessary files in a directory, obfuscating them, with an executable frontend: pyinstaller at http://www.pyinstaller.org/ ; it appears to be actively supported, as the last version 3.4 which was released on 2018-09-09, contrary to py2bin which seems to be not actively maintained.
Features:
- Packaging of Python programs into standard executables, that work on computers without Python installed.
- Multi-platform, works under:
Windows (32-bit and 64-bit),
Linux (32-bit and 64-bit),
Mac OS X (32-bit and 64-bit),
contributed suppport for FreeBSD, Solaris, HPUX, and AIX.- Multi-version:
supports Python 2.7 and Python 3.3—3.6.
To install:
pip install pyinstallerThen, go to your program’s directory and run:
pyinstaller yourprogram.pyThis will generate the bundle in a subdirectory called dist.
Try Nuitka. It takes a .py and then creates a .bin.
It works on Gnu+Linux and is in most popular distribution's software repositories.
Nuitka is a Python compiler written in Python.
It's fully compatible with Python 2.6, 2.7, 3.3, 3.4, 3.5, 3.6, and 3.7.
You feed it your Python app, it does a lot of clever things, and spits out an executable or extension module.
Free license (Apache).
https://nuitka.net/pages/overview.html
I have written a script for extracting and storing a data into CSV. I have written the program in python in windows OS. I want to run this script in my clients system which is a Linux OS without installing python in it. What are my options?
I have tried pythoninstaller and the executable it is creating (.exe) is running for windows but not for Linux. Can I use pythoninstaller to create a executable file for Linux?
Sorry if I am using wrong terminologies.