Skip to main content


Creating a Stand Alone EXE with Python Script using PyInstaller

In this video

I am going to show How to Make a Stand Alone Executable from a Python Script using PyInstaller. We will use PyInstaller to convert .py to .exe.  PyInstaller converts Python applications into stand-alone executables, under Windows, GNU/Linux, Mac OS X. So let us see How to Create a .exe of a Python Program. Creating an Executable from a Python Script is easy using PyInstaller.

To install
In CMD > [Type]
pip install pyinstaller

pyinstaller --onefile <YOUR PYTHON SCRIPT APP>

Suppose your Python Script name is "hello_app.py"
=======================================
Eg.2 pyinstaller hello_app.py
Eg.2 pyinstaller --onefile hello_app.py
Eg.3 pyinstaller -w hello_app.py
=======================================

useful links
https://www.pyinstaller.org/
https://youtu.be/drBIgmIzqiY
First Create a text file and name it "text_speech.txt" and type something readable.

import tkinter as tk
import win32com.client

class Application (tk.Frame):
     def read(self):
          print("reading...")
          speaker = win32com.client.Dispatch("SAPI.SpVoice")
          file = open("text_speech.txt","r")
          string = file.read()
          speaker.Speak(string)
          
     def create_Widget(self):
          self.quit = tk.Button(self, text = "Quit", fg = "red", command = self.master.destroy)
          self.quit.pack(side = "right")

          self.start = tk.Button(self, text = "Read", fg = "green")
          self.start["command"] = self.read
          self.start.pack(side = "left")

     def __init__(self, master=None):
          super().__init__(master)
          self.master = master
          self.pack()
          self.create_Widget()

root = tk.Tk()
root.geometry("400x30")
app = Application(master = root)
app.master.title("Speech App by Python")
app.mainloop()

#Python #PyInstaller
Feel the real power of Python and programming! This is a Python tutorial for beginners to learn Python programming from scratch. The course offers you a unique approach of learning how to code by solving real world problems. Throughout the course we will be understanding how to identify and formulate the problems, what is the key to a great app, we will learn how to efficiently adopt the problem for the computer and the most important that you will be writing a lot of code! The course is structured in a way that lectures are like labs where we study the material, do the quizzes, write programs and test them! The most important that you will be involved into work a lot in order to get the best experience! Learn Python at easy to understand steps.


🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍🐍

Popular Posts

Python underline string, Python underline text, Underline python print

Python pip - Installing modules from IDLE (Pyton GUI) for python 3.7

Top 40 Python - String Processing in Python | Working with String in Python

Python Program - When was I born? / Date of Birth / MY BIRTHDAY (using Python3+)

Top 11 Essential Python Tips and Tricks





Subscribe to our Channel


Follow us on Facebook Page

Join our python facebook groups



Join us on Telegram