I wanted to open apps like calculator, camera, and other apps using the python OS module how can I use the os.startfile() function to open apps like this?
Asked
Active
Viewed 497 times
-1
-
2Welcome to Stackoverflow. Please take the [tour](https://stackoverflow.com/tour) and read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) – Lucan May 10 '21 at 10:05
2 Answers
0
It's very simple
import os
os.system("program_name") # To open any program by their name recognized by windows
#for example
os.system("notepad")
There you go

Frosty Boi FN
- 21
- 1
- 3
0
You can simply use the os module
import os
# call startfile method to “start” a file with its associated (default) program
os.startfile(filepath)

Mahrez BenHamad
- 1,791
- 1
- 15
- 21