Python’s OS Module:
The OS module in Python provides a way of using operating system dependent functionality. The functions that the OS module allows you to interface with the Windows operating system where Python is running on.
os.system( ): Execute the C++ compiling command (a string contains Unix, C command which also supports C++ command) in the shell (Here it is Command Window).
For Example to – compile C++ program g++ compiler should be invoked. To do so the following command is used.
os.system (g++’ +<varaiable_namel>'-<mode>'+<variable_name2>
where,
For example the command to compile and execute C++ program is given below
os.system(’g++ ’+ cpp_file + ‘-o ‘+ exe_file) g++ compiler compiles the file cpp_file and -0(output) send to exe_file