hello stdin world>spam 'spamprint('hello stdin world>')sys stdin readline()[:- hello stdin worldeggs 'eggsstandard streams on windows windows usersif you click py python program' filename in windows file explorer to start it (or launch it with os system) dos console window automatically pops up to serve as the program' standard stream if your program makes windows of its ownyou can avoid this console pop-up window by naming your program' source-code file with pyw extensionnot with py extension the pyw extension simply means py source file without dos pop up on windows (it uses windows registry settings to run custom version of pythona pyw file may also be imported as usual also note that because printed output goes to this dos pop up when program is clickedscripts that simply print text and exit will generate an odd "flash"--the dos console box pops upoutput is printed into itand the pop up goes away immediately (not the most user-friendly of features!to keep the dos pop-up box around so that you can read printed outputsimply add an input(call at the bottom of your script to pause for an enter key press before exiting redirecting streams to files and programs technicallystandard output (and printtext appears in the console window where program was startedstandard input (and inputtext comes from the keyboardand standard error text is used to print python error messages to the console window at least that' the default it' also possible to redirect these streams both to files and to other programs at the system shellas well as to arbitrary objects within python script on most systemssuch redirections make it easy to reuse and combine general-purpose command-line utilities redirection is useful for things like canned (precodedtest inputswe can apply single test script to any set of inputs by simply redirecting the standard input stream to different file each time the script is run similarlyredirecting the standard output stream lets us save and later analyze program' outputfor exampletesting systems might compare the saved standard output of script with file of expected output to detect failures although it' powerful paradigmredirection turns out to be straightforward to use for instanceconsider the simple read-evaluate-print loop program in example - script execution context