of currency symbols may apply)import os os popen('dir'read line by line readline(volume in drive has no label \nf os popen('dir'read by sized blocks read( volume in drive has no label \ volume serial nuos popen('dir'readlines()[ read all linesindex volume in drive has no label \nos popen('dir'read()[: read all at onceslice volume in drive has no label \ volume serial nufor line in os popen('dir')print(line rstrip()volume in drive has no label volume serial number is - and so on file line iterator loop this runs dir directory listing on windowsbut any program that can be started with command line can be launched this way we might use this schemefor exampleto display the output of the windows systeminfo command--os system simply runs shell commandbut os popen also connects to its streamsboth of the following show the shell command' output in simple console windowbut the first might not in gui interface such as idleos system('systeminfo'output in consolepopup in idle for line in os popen('systeminfo')print(line rstrip()host namemark-vaio os namemicrosoft windows professional os versionservice pack build lots of system information text and once we have command' output in text formany string processing tool or technique applies--including display formatting and content parsingformattedlimited display for (ilinein enumerate(os popen('systeminfo'))if = break print('% % (iline rstrip()) host namemark-vaio os namemicrosoft windows professional os versionservice pack build parse for specific linescase neutral for line in os popen('systeminfo')parts line split(':'if parts and parts[ lower(='system type'print(parts[ strip() while and for loops