Oh Snap!

Please turnoff your ad blocking mode for viewing your site content

Hit enter after type your search item

Python PyAutoGUI Script to Execute Shell Commands in GUI and Show the Result in Popup Window Desktop App Full Project For Beginners

/
/
/
59 Views

 

Welcome folks today in this post we will be executing shell commands in pyautogui library using python. All the full source code of the application is shown below.

 

 

Get Started

 

 

In order to get started you need to install the following library using the pip command as shown below

 

pip install pyautogui

 

After installing this library make an app.py file and copy paste the following code

 

app.py

 

 

# import required modules 
import os 
import pyautogui 

# prompts message on screen and gets the command 
# value in val variable 
value = pyautogui.prompt("Enter Shell Command") 

# executes the command and returns 
# the output in stream variable 
stream = os.popen(value) 

# reads the output from stream varible 
out = stream.read() 
pyautogui.alert(out)

 

 

And now if you execute the above script by typing the below command

READ  Python Tkinter GUI Script to Make a GST Tax Finder Calculator Full Project For Beginners

 

python app.py

 

 

 

 

Now you can see that we are entering the shell command inside the gui to print the version of node and then inside the popup window it it printing out the result of shell command which is the version of nodejs which is v12.16.3 installed on my machine

Leave a Comment

Your email address will not be published. Required fields are marked *

This div height required for enabling the sticky sidebar
Coding Shiksha 2020. All Rights Reserved.
Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views : Ad Clicks : Ad Views :