How to use python os.system() method
This tutorial is How to use python os.system() method. The OS module provides functions for interacting with the operating system. OS module provides a portable way of using operating system dependent functionality.
os.system method has used the shell of the Operating system is opened and the command is executed on it.
Syntax
os.system(command)
Example
#Get current date import os command = 'date' os.system(command) Output: Thu Oct 8 15:14:23 IST 2020
Example
#Run Calander
import os
command = 'cal'
os.system(command)
Output:
October 2020
Su Mo Tu We Th Fr Sa
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31