import sys
sys.stdin
and sys.stdout
sys.stdin
and sys.stdout
sys.stdin
and sys.stdout
are useful when creating an interactive session. sys.stdin
is a file object and we can loop it through its iterator:
Status Bar
Build a status bar using sys.stdout.write
. The \r
moves the cursor to the beginning of the line:
input()
vs. sys.stdin.readline()
input()
vs. sys.stdin.readline()
Reference
Last updated