Can I turn exe file into .app file for mac - python

I have a c++ file and a python file.
I can turn both of these to .exe files. But I can't turn them into .app files.
I am using the pyinstaller module for python files.
How can I turn the files into .app files?

As per PyInstaller's documentation, you can use it also to build a mac application. However, you would have to build it from Mac OS.
https://pyinstaller.readthedocs.io/en/stable/usage.html#building-mac-os-x-app-bundles

Related

Pyinstaller - convert python to exe from Linux

I want to convert one .py file to .exe from Linux Ubuntu. I found pyinstaller for this. But when pyinstaller runs from Linux it makes file executable only for Linux and when pyinstaller runs from Windows it makes .exe file for Windows. I want to convert .exe file from Linux for Windows. So how can i make it? I need an instruction.
P.S: if i cannot do it with pyinstaller, please write other tool.
If you know how to use Docker, that may be an easy enough way to do it. The relevant docker images can be found here.
From the documentation there:
There are two containers, one for Linux and one for Windows builds.
The Windows builder runs Wine inside Ubuntu to emulate Windows in
Docker.
To build your application, you need to mount your source code into the
/src/ volume.
The source code directory should have your .spec file that PyInstaller
generates. If you don't have one, you'll need to run PyInstaller once
locally to generate it.
If the src folder has a requirements.txt file, the packages will be
installed into the environment before PyInstaller runs.
For example, in the folder that has your source code, .spec file and
requirements.txt:
docker run -v "$(pwd):/src/" cdrx/pyinstaller-windows
will build your
PyInstaller project into dist/windows/. The .exe file will have the
same name as your .spec file.
docker run -v "$(pwd):/src/" cdrx/pyinstaller-linux
will build your PyInstaller project into dist/linux/. The binary will have the same
name as your .spec file.

Run a ubuntu file in windows as executable file

I have made a python file and converted it to executable file with pyinstaller in Ubuntu, now I want to run the same executable file in windows, how would I do that?
Oups... Programs exists in different formats, normally text (.py for Python), byte code (.pyc) for Python and native executable formats. Text is normally portable across any architecture except for possible charset conversions. Byte code is normally portable, I am sure for Java, less for Python because I have never used it. But native executable formats (true executable in Linux or .exe files on Windows) are dedicated to one single architecture.
So a program generated by pyinstaller on Ubuntu can only be used on a Linux system with same system libraries as yours (read Ubuntu same version, even if it should also run on some other Linux flavours), but definitely not on Windows.
You have to install pyinstaller on windows, and run pyinstaller on windows (From the OS that you want to build your exe file)

exe file generated by py2exe cannot do file operations

Here's my situation. I used py2exe to generated some python codes to exe in Windows, everything works fine except for the file operations. The exe file cannot create open, read or close files while the python scripts works fine.
It is a simple pyqt program that only includes some dialogs, string operations, and saving the results into a file.
Anyone has any clue about it? My python version is 3.4 and OS is Win7

Convert .py to .exe that works on all windows?

I converted my gui.py to gui.exe with py2exe, but it works only on windows 8 64 bit, when I tried it on win7 32 bit , it won't work
this code that converted .py to .exe
from distutils.core import setup
import py2exe
setup(console=['gui.py'])
any way to convert .py to .exe that works on all windows operating systems ...?
You're building a 64-bit .exe, which won't work on 32-bit Windows. Install a 32-bit copy of Python and use that to make the package - it will be 32-bit then.
You can use something called pyinstaller. Install it using pip install PyInstaller. To use it follow these steps.
In command line do pyinstaller your_file.py
In file explorer go to your your folder where the python file was created. In that folder you will see a folder called dist. In that folder there will be a executable file which is your_file.exe or your_file without extension.
This works for both 64-bit and 32-bit!

Which files to distribute using cx_Freeze?

I'm using cx_freeze to freeze a Python script for distribution to other windows systems. I did everything as instructed and cx_freeze generated a build\exe.win32-2.6 folder in the folder containing my sources. This directory now contains a a bunch of PYD files, a library.zip file, the python DLL file and the main executable. Which of these files would I need to distribute? Any help, guys?
Thanks in advance.
You need all of them.

Categories

Resources