How to Run Exe From Python Quick Guide

Share This Post

Yesterday I just started working on Python and I have been trying exe I faced many problems here in this post I will discuss with you about exe like how to run exe from Python. Now I will tell in easy ways such as to the point so let’s start.

Ways to Run Exe From Python

First of all, we will have to make a file for Python so, don’t worry about anything below we have a code that helps you to make a file for python just copy the code and paste it on your file. Make sure that you installed pip pyinstaller.


pip install pyinstaller

cd PathOfFile

pyinstaller --OneFile -w ScriptName.py

(note that if you are using -w then your python file has to be an application and the file will be inside the "dist" folder)

How to run a .exe through Python

If you want to through an exe using Python then you can see just paste this code and change this line C:\Documents and Settings\flow_model\flow.exe 


import os
os.startfile("C:\Documents and Settings\flow_model\flow.exe")

 

spot_img

Related Posts

Python for Loop Iteration: How to Easily Manipulate a List

One of the most powerful features of the Python...

How To Get First Characters of a String in Python

Way to find the first characters of a string...

How To Convert Tuple To String In Python

In this post, you will learn how to convert...

How To Convert String to Double in Python

Good to hear, that you want to convert a...

Python TypeError: String Index Out Of Range Solution

A string is an array of characters and part...

How To Remove Empty Strings From a List Of Strings

On this page, we will discuss how to remove...
- Advertisement -spot_img