Difference between revisions of "Python reading from standard in"

From MyWiki
Jump to: navigation, search
(Created page with "<source lang="python"> import sys for line in sys.stdin: sys.stdout.write(line) </source>")
 
 
Line 5: Line 5:
 
     sys.stdout.write(line)
 
     sys.stdout.write(line)
  
 
+
Why is this not working in python2
  
 
</source>
 
</source>

Latest revision as of 15:34, 2 June 2018

import sys
 
for line in sys.stdin:
    sys.stdout.write(line)
 
Why is this not working in python2