|
1 |
| -# Python-Script-to-Application |
| 1 | +# Python Script to Application |
2 | 2 |
|
3 | 3 | **To create an (.exe) executable application file from a python script**.
|
4 | 4 |
|
5 | 5 | ## Steps :
|
6 | 6 |
|
7 |
| -**1.** Install **[Inno Setup Compiler](tools/innosetup-6.1.2.exe)** free application and Pyinstaller. </br> |
| 7 | +1. Install **[Inno Setup Compiler](tools/innosetup-6.1.2.exe)** free application and Pyinstaller. </br> |
8 | 8 |
|
9 | 9 | Open **windows shell** and run :
|
10 | 10 |
|
|
13 | 13 | pip install pyinstaller
|
14 | 14 |
|
15 | 15 | ```
|
16 |
| -**2.** Save Python script with all the resources in one folder. |
| 16 | +2. Save Python script with all the resources in one folder. |
17 | 17 |
|
18 |
| -**3.** Open folder and press 'Shift + right click' select **Open PowerShell window**. |
| 18 | +3. Open folder and press 'Shift + right click' select **Open PowerShell window**. |
19 | 19 |
|
20 | 20 |
|
21 | 21 | Run below commands:
|
@@ -52,44 +52,49 @@ pyinstaller -F -i "mylogo.ico" myprogram.py --onefile --noconsole
|
52 | 52 | pyinstaller -F -i "mylogo.ico"--add-data "Additionalimage.png;." myprogram.py --onefile --noconsole
|
53 | 53 |
|
54 | 54 | ```
|
55 |
| -**4.** Go to **dist** folder and get application file, delete remain file except for resources.</br> |
| 55 | +4. Go to **dist** folder and get application file, delete remain file except for resources.</br> |
56 | 56 |
|
57 | 57 |
|
58 |
| - **Congratulations ! 🤩 you successfully created your standalone application.**</br> |
| 58 | + **🤩 Congratulations**, you successfully created your standalone application</br> |
| 59 | + |
59 | 60 |
|
60 | 61 | However if you want your application as **setup.exe**, then windows installer will extract the installation resources from itself and manage their installation directly.</br>
|
61 | 62 |
|
62 |
| -**5.** Open Inno setup to make (.exe) file which is Installable/Executable in Windows PC, select **Create a new script file using Script Wizard** and browse to select your application.</br> |
| 63 | + |
| 64 | +5. 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.</br> |
63 | 65 |
|
64 | 66 |
|
65 |
| -**6.** Select all required things for your application such as Icon of setup file, Before installation document, Licence .etc</br> |
| 67 | +6. Select all required things for your application such as Icon of setup file, Before installation document, Licence .etc</br> |
66 | 68 |
|
67 | 69 |
|
68 |
| -**7.** Click **Yes** to all, in the end go to Output Folder get **setup file** of application and click on open to install.</br> |
| 70 | +7. Click **Yes** to all, in the end go to Output Folder get **setup file** of application and click on open to install.</br> |
69 | 71 |
|
70 | 72 |
|
71 |
| -**Yor're done !** |
| 73 | +**You're done !** |
72 | 74 |
|
73 | 75 | ## Precautions :
|
74 |
| -:heavy_check_mark: Save the resources in one folder, Do not save the folder inside another folder. |
| 76 | +1. Save the resources in one folder, Do not save the folder inside another folder |
75 | 77 |
|
76 |
| -> *It will not give full permission to execute the commands. # ParentContainsErrorRecordException* |
| 78 | + - It will not give full permission to execute the commands.</br> # ParentContainsErrorRecordException |
77 | 79 |
|
78 | 80 |
|
79 |
| -:heavy_check_mark: Check Spellings before running the commands, Do not put any _space_ in your main python (.py) programme file name. |
| 81 | +2. Check Spellings before running the commands, Do not put any _space_ in your main python (.py) programme file name. |
80 | 82 |
|
81 |
| -> *File not found show* |
| 83 | + - File not found show |
82 | 84 |
|
83 |
| -:heavy_check_mark: Do not use the _icon_ word as a name of your icon (.ico) file, always use a different name. |
| 85 | +3. Do not use the _icon_ word as a name of your icon (.ico) file, always use a different name. |
84 | 86 |
|
85 |
| -> *It will show no icon file found.* |
| 87 | + - It will show no 'icon file found' |
86 | 88 |
|
87 |
| -:heavy_check_mark: Do not Close Powershell window until **Building EXE from EXE-00.toc completed successfully** |
| 89 | +4. Do not Close Powershell window until **Building EXE from EXE-00.toc completed successfully** |
88 | 90 | Message not shows.</br>
|
89 | 91 |
|
90 | 92 | ### Refrences
|
91 | 93 | * [Pyinstaller](https://pyinstaller.readthedocs.io/en/stable/operating-mode.html)
|
92 | 94 | * [Inno Setup Compiler](https://jrsoftware.org/isdl.php)</br>
|
93 | 95 | * [Real Python](https://realpython.com/pyinstaller-python/#:~:text=PyInstaller%20supports%20making%20executables%20for,machine%20for%20each%20supported%20OS)
|
94 | 96 | * Feel free to report <b>[issues](https://github.com/Abhijeetbyte/Python-Script-to-Application/issues/new)</b>
|
| 97 | + |
| 98 | + |
| 99 | + |
95 | 100 |
|
0 commit comments