Psgcompiler A PySimpleGUI Application - Transform your Python programs in Windows, Mac, and Linux binary executables

Overview

Python GUIs for Humans

psgcompiler

A PySimpleGUI Application

"Compile" your Python programs into an EXE for Windows, an APP for Mac, and a binary for Linux

Installation

Old-school Straight Pip

pip install psgcompiler

pip via python -m pip the python recommended way

If python is your command

python -m pip install psgcompiler

If python3 is your command

python3 -m pip install psgcompiler

Usage

Open a command window and type:

psgcompiler

PyInstaller Back-end with a PySimpleGUI Front-end

The plan for psgcompiler is to provide a GUI interface for a number of the tools available to convert a Python program into a binary executable. PyInstaller was chosen as the first back-end tool that does the heavy-lifting of converting your code into a binary executable. The next one being added is cx_freeze.

psgcompiler collects the options that are assembled into the command that can then be run for you by launching a subprocess. You will see the command being built as you add or remove items using the GUI. You can run PyInstaller manually using the options shown in the "Command" box. Type pyinstaller on the command line and paste the text you see under "Command" in the Home tab of the psgcompiler program.

PyInstaller transforms your Python project into an executable that you can distribute to friends, family members, colleagues, the public, other developers, ... Anyone that does not have Python installed on their machine will be able to run your program after you've turned it into a binary executable.

PySimpleGUI users in particular will greatly benefit from psgcompiler as you'll be able to distribute "Windows Programs". Most likely no one will know you're using Python. On Windows, you can create a single EXE file. One-file is the default setting. After converting, you'll be left with a single EXE file.

A Multitude Of Options

PyInstaller has a sh*t-ton of options! Unlike the primitive EXE Maker that the PySimpleGUI project created, the psgcompiler exposes all of the options in an easy to use way.

Simple Interface, Complex Settings

While psgcompiler makes it easy to specify the many options available for PyInstaller, it doesn't remove the complexity that comes with using PyInstaller.

Please refer to the PyInstaller documentation to better understand the available options. It can be tricky to convert some programs, particularly if you're using other Python packages in addition to PySimpleGUI.

All Python Programs Welcomed...

Your Python program doesn't have to use PySimpleGUI in order to use the psgcompiler tool. PySimpleGUI is being used to give you a GUI front-end to PyInstaller. There is no requirement that your program use PySimpleGUI.

Troubleshooting PyInstaller Problems

When it comes to PyInstaller use, I'm a user of PyInstaller, just as you are. The PySimpleGUI project isn't populated with PyInstaller experts. You'll need to use your programming prowess to find answers to problems you may encounter using PyInstaller.

We're making it easy for you to run PyInstaller, and soon additional similar utilities, but that doesn't mean it's going to be easy overall.

The PyInstaller documentation is well-written and can be found here:
https://pyinstaller.readthedocs.io/en/stable/

A Simple EXE

If your program is relatively simple, then you only need to supply the name of your Python file, and an optional icon file.

Here is an example session showing only the .pyw file and the .ico file being supplied.

Additional Back-ends

Currently in the works is support for additional back-ends. cx_freeze is up next.

Create a Shortcut To This Program

If you're a Windows user, then use the psgshortcut application to make a shortcut to this program so that you can then put on your desktop or pin to your taskbar (or any other use that stops the need to type psgcompiler ever again).

Release Notes

1.5.0 14-Nov-2021

  • Added PyInstaller Help link just above the "Convert" button

1.4.0 14-Nov-2021

  • Debug counter added to event loop
  • Updated readme for PyPI

1.3.0 13-Nov-2021

  • Version number of psgcompiler, PyInstaller both added to right-click-menu and to version popup

1.2.0 13-Nov-2021

  • Added version number in the .py file
  • Added version number to right click menu
  • Added local copy of version for debugging
  • Posted to PyPI

1.0.0 13-Nov-2021

  • Initial release, post to PyPI and GitHub

License

Licensed under an LGPL3 License
Copyright 2021

This PySimpleGUI Application Was Designed and Written By

Tanay Findley as part of The PySimpleGUI Project

Contributing

Like the PySimpleGUI project, this project is currently licensed under an open-source license, the project itself is structured like a proprietary product. Pull Requests are not accepted.

Copyright

Copyright 2021 PySimpleGUI

You might also like...
A library and tool for generating .pex (Python EXecutable) files

PEX Contents Overview Installation Simple Examples Integrating pex into your workflow Documentation Development Contributing Overview pex is a library

FreezeUI is a python package that creates applications using cx_freeze and GUI by converting .py to .exe .
FreezeUI is a python package that creates applications using cx_freeze and GUI by converting .py to .exe .

FreezeUI is a python package use to create cx_Freeze setup files and run them to create applications and msi from python scripts (converts .py to .exe or .msi .

A library which implements low-level functions that relate to packaging and distribution of Python

What is it? Distlib is a library which implements low-level functions that relate to packaging and distribution of Python software. It is intended to

Auto locust load test config and worker distribution with Docker and GitHub Action

Auto locust load test config and worker distribution with Docker and GitHub Action Install Fork the repo and change the visibility option to private S

Python virtualenvs in Debian packages

dh-virtualenv Contents Overview Presentations, Blogs & Other Resources Using dh-virtualenv How does it work? Running tests Building the package in a D

A tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.

PyArmor Homepage (中文版网站) Documentation(中文版) PyArmor is a command line tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine

shiv is a command line utility for building fully self contained Python zipapps as outlined in PEP 441, but with all their dependencies included.

shiv shiv is a command line utility for building fully self-contained Python zipapps as outlined in PEP 441, but with all their dependencies included!

Core utilities for Python packages

packaging Reusable core utilities for various Python Packaging interoperability specifications. This library provides utilities that implement the int

Python Wheel Obfuscator

pywhlobf obfuscates your wheel distribution by compiling python source file to shared library.

Comments
  • The Button to select a specific pyinstaller targets the icon field not the pyinstaller one

    The Button to select a specific pyinstaller targets the icon field not the pyinstaller one

    In the definition of the layout:

    ...
                  [sg.Text('Icon: ', s=20), sg.Input(key='-ICONFILE-', expand_x=True, enable_events=True),
                     sg.FileBrowse(target='-ICONFILE-', file_types=(("Icon Files", "*.ico"),))],
                    [sg.Text('Optional specific pyinstaller: ', s=20), sg.Input(key='-PYINSTALLER-', expand_x=True),
                     sg.FileBrowse(target='-ICONFILE-', file_types=(("Icon Files", "*.ico"),))],
    ...
    

    the FileBrowse button for picking a pyinstaller executable should target the '-PYINSTALLER-' Input field and should probably have filetypes as something like ("All files", "*.*").

    opened by andrewmk 2
  • UTF-8 decode error if the path to the script contains letters not in the standard English alphabet

    UTF-8 decode error if the path to the script contains letters not in the standard English alphabet

    Description of the issue

    I was a bit unsure of whether to submit the issue here or in the pyinstaller repo. I'll start here.

    If your script and/or icon is located in a folder where the path has letters such as æ, ø or å (in other words non-English letters) it will fail and display an error (utf-8 decode error: invalid continuation byte - see section below). Initially, I thought it was due to the & being included in one of the folder names, but tests show that is not the issue. What is really weird is that the position reported in the log is not even one that corresponds to æ, ø or å in the path given further down. It is - as far as I can tell - an s (unless I'm reading the log incorrectly).

    Context information

    PSGCompiler version: 1.5.0 PyInstaller version: 5.7.0 Python version: 3.10.8 Platform: Windows-10-10.0.19044-SP0 Other platforms: I have not tried this on other platforms nor do I have the option to.

    Example program

    import PySimpleGUI as gui
    
    
    layout = [[gui.Text('Kør mangelmotor')], [gui.Button('OK')]]
    main_window = gui.Window(title='Mangelmotoren', icon='GUI\Resources\mm_ikon.ico', layout=layout, margins=(100, 50))
    
    while True:
        event, values = main_window.read()
    
        if event == 'OK' or event == gui.WIN_CLOSED:
            break
    
    main_window.close()
    

    Steps to re-produce error

    Create a folder with the letters mentioned in the first section of this issue (or other non-English letters). The path I used was:

    G:/ADM/Administration & Service/Administration/Økonomi/Ledelsesinformation/Mangelkontrol/Mangelmotor/Udvikling/GUI/main_window.py

    Stacktrace / full error message

    [EXE Maker] Starting process...
    264 INFO: PyInstaller: 5.7.0
    264 INFO: Python: 3.10.8
    295 INFO: Platform: Windows-10-10.0.19044-SP0
    [EXE Maker] *********************** FAILED ***********************
    'utf-8' codec can't decode byte 0xd8 in position 63: invalid continuation byte
    
    opened by denivic 0
Owner
PySimpleGUI
Now Python programmers of all skill levels can make GUI programs. Commercial interests can contact: [email protected]
PySimpleGUI
Create standalone executables from Python scripts, with the same performance and is cross-platform.

About cx_Freeze cx_Freeze creates standalone executables from Python scripts, with the same performance, is cross-platform and should work on any plat

Marcelo Duarte 1k Jan 4, 2023
Subpar is a utility for creating self-contained python executables. It is designed to work well with Bazel.

Subpar Subpar is a utility for creating self-contained python executables. It is designed to work well with Bazel. Status Subpar is currently owned by

Google 550 Dec 27, 2022
A distutils extension to create standalone Windows programs from Python code

py2exe for Python 3 py2exe is a distutils extension which allows to build standalone Windows executable programs (32-bit and 64-bit) from Python scrip

py2exe 526 Jan 4, 2023
py2app is a Python setuptools command which will allow you to make standalone Mac OS X application bundles and plugins from Python scripts.

py2app is a Python setuptools command which will allow you to make standalone Mac OS X application bundles and plugins from Python scripts. py2app is

Ronald Oussoren 222 Dec 30, 2022
Build Windows installers for Python applications

Pynsist is a tool to build Windows installers for your Python applications. The installers bundle Python itself, so you can distribute your applicatio

Thomas Kluyver 818 Jan 5, 2023
Python-easy-pack For Linux/Unix, Changed by laman28

Python-easy-pack For Linux/Unix, Changed by laman28

LMFS 2 Jan 28, 2022
Anaconda is the OS installer used by Fedora, RHEL, CentOS and other Linux distributions.

Anaconda is the OS installer used by Fedora, RHEL, CentOS and other Linux distributions. Documentation Documentation for the Anaconda install

Red Hat Installer Engineering Team 454 Jan 8, 2023
Nuitka Organization 8k Jan 7, 2023
A modern Python application packaging and distribution tool

PyOxidizer PyOxidizer is a utility for producing binaries that embed Python. The over-arching goal of PyOxidizer is to make complex packaging and dist

Gregory Szorc 4.5k Jan 7, 2023
The Application can convert the .py file into exe for faster transformation and can result to build an app in a single click

PEXEY PEXEY Is a high robust py to exe app made top on pyinstaller this application is for the developer who constantly keep making py to exe apps IMP

Aaris Kazi 11 Dec 15, 2022