GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Abhijeetbyte/Python-Script-to-Application: The simplest and efficient way to convert your python script into an executable setup file for PC with a complete guide, resources, and example files

BranchesTags
Open more actions menu

Latest commit

 

History

61 Commits
61 Commits

Folders and files

NameName
Last commit message
Last commit date
examples
examples
 
 
tools
tools
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

Python Script to Application

To create an (.exe) executable application file from a python script.

Documentation Languages OS

Steps :

  1. Install Inno Setup Compiler free application and Pyinstaller.

    • Your computer must be running Python3 or newer.

    Open windows shell and run :

pip install pyinstaller 
  1. Save Python script with all the resources in one folder.

  2. Open folder and press 'Shift + right click' select Open PowerShell window.

    Run below commands:

  • If no custom icon file were used.
pyinstaller myprogram.py
  • With custom icon file (-F -i " " command).
pyinstaller -F -i "mylogo.ico" myprogram.py
  • ( mylogo.ico = icon file name, myprogram.py = Python file name )
  • If you want your executable application in one file --onefile and no console running --noconsole behind your application then go with the below line. If your app requires Windows Administrator permission then use --uac-admin command
pyinstaller -F -i "mylogo.ico" myprogram.py --onefile --noconsole
  • If you want your executable application with additional file --add-data command, then go with the below line.
pyinstaller -F -i "mylogo.ico"--add-data "Additionalimage.png;." myprogram.py --onefile --noconsole
  1. Go to dist folder and get application file, delete remain file except for resources.
    You successfully created your standalone application.
  • However if you want your application (.exe) as setup file, windows installer will extract the installation resources from itself and manage their installation directly then, go with the below steps.
  1. Open Inno setup to make (.exe) file which is Installable/Executable in PC, select create a new script file using Script Wizard and browse to select your application.

  2. Select all required things for your application such as Icon of setup file, Before installation document, Licence .etc

  3. Click Yes to all, in the end go to Output Folder get setup file of application and click on open to install.

    You're done !

Precautions :

  1. Save the resources in one folder, Do not save the folder inside another folder

    • It will not give full permission to execute the commands.
      # ParentContainsErrorRecordException
  2. Check Spellings before running the commands, Do not put any space in your main python (.py) programme file name.

    • File not found show
  3. Do not use the icon word as a name of your icon (.ico) file, always use a different name.

    • It will show no 'icon file found'
  4. Do not Close Powershell window until Building EXE from EXE-00.toc completed successfully Message not shows.

Refrences

  • Pyinstaller
  • Inno Setup Compiler
  • Real Python

Feel free to report issues

About

The simplest and efficient way to convert your python script into an executable setup file for PC with a complete guide, resources, and example files

Topics

exeexe-setupinno-setuppy2exepyinstallerpythonpython-applicationpython-application-setuppython-to-exepython-windows-applicationsetupwindowswindows-executable

Resources

Readme
MIT license
Activity

Stars

5 stars

Watchers

2 watching

Forks

3 forks
Report repository

Contributors

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.