def getreply()? but now the script also correctly pages text redirected into stdin from either file or command pipeeven if that text is too long to fit in single display chunk on most shellswe send such input via redirection or pipe operators like thesec:\pp \system\streamspython moreplus py moreplus py ""split and interactively page stringfileor stream of text to stdoutwhen run as scriptpage stdin or file whose name is passed on cmdlineif input is stdincan' use it for user reply--use platform-specific tools or gui""import sys def getreply()? :\pp \system\streamstype moreplus py python moreplus py ""split and interactively page stringfileor stream of text to stdoutwhen run as scriptpage stdin or file whose name is passed on cmdlineif input is stdincan' use it for user reply--use platform-specific tools or gui""import sys def getreply()? finallypiping one python script' output into this script' input now works as expectedwithout botching user interaction (and not just because we got lucky)\system\streamspython teststreams py input txt python moreplus py hello stream world enter number> squared is enter number> squared is enter number>bye herethe standard output of one python script is fed to the standard input of another python script located in the same directorymoreplus py reads the output of teststreams py all of the redirections in such command lines work only because scripts don' care what standard input and output really are--interactive usersfilesor pipes between programs for examplewhen run as scriptmoreplus py simply reads stream sys stdinthe command-line shell ( dos on windowscsh on linuxattaches such streams to the source implied by the command line before the script is started script execution context