I was wondering if i could open any kind of application in Python during runtime?
A Python script can start other programs on your computer. For example, it can open up the calculator (to do calculations) or it can open up notepad (so that you can write a document). Or it can open up a sound file that can be played.
To run Python scripts with the python command, you need to open a command-line and type in the word python , or python3 if you have both versions, followed by the path to your script, just like this: $ python3 hello.py Hello World! If everything works okay, after you press Enter , you'll see the phrase Hello World!
Assuming that you are using Windows you would use one of the following commands like this.
subprocess.call
import subprocess
subprocess.call('C:\\myprogram.exe')
os.startfile
import os
os.startfile('C:\\myprogram.exe')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With