Answers for "how to open apps using python"

2

how to open any application using python

import os

os.system("program_name") # To open any program by their name recognized by windows

# OR

os.startfile("path to application or any file") # Open any program, text or office document
Posted by: Guest on January-05-2021
2

open applications by python

dir = 'C:\\myprogram.exe'

import os
os.startfile(dir)
os.system(dir)

import subprocess
subprocess.Popen([dir])
subprocess.call(dir)
Posted by: Guest on July-20-2020
1

how to open apps using python

import pyttsx3
import subprocess 
import os
import time


pyttsx3.speak("Hi user")
time.sleep(2)
pyttsx3.speak("you can open any apps in this coming list")
time.sleep(3)
print("You can open any app from this list:- ")  
print("NOTEPAD \t GOOGLE\nVirtual Box \t unity \nEXIT ")

while True:
    # take input
    
    print("Chat with me which app to open : ", end='')
    p = input().upper()
    print(p)
  
    if ("NOTE" in p) or ("NOTES" in p) or ("NOTEPAD" in p) :
        pyttsx3.speak("Opening , Notepad")
        os.system("notepad.exe")
        
   
  
    elif ("GOOGLE" in p or "CHROME" in p):
        pyttsx3.speak("opening chrome please wait")
        time.sleep(3)
        subprocess.call(['C:/Program Files (x86)/Google/Chrome/Application/chrome'])

    
    elif "UNITY" in p:
        pyttsx3.speak("Opening unity")
        subprocess.call(['file path of unity'])
    
        
    elif ("EXIT" in p) or ("QUIT" in p) or ("CLOSE" in p):
        print("thanks")
        time.sleep(1)
        pyttsx3.speak("Exiting this app thanks for using this app")
        break
  
    else:
        print("Is Invalid,Please Try Again")
        pyttsx3.speak("its Invalid,Please try again ")
Posted by: Guest on August-04-2021

Code answers related to "how to open apps using python"

Python Answers by Framework

Browse Popular Code Answers by Language