📜  python 从标准输入管道读取 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:13.854000             🧑  作者: Mango

代码示例1
k = 0
try:
    while True:
        print sys.stdin.readline()
        k += 1
except KeyboardInterrupt:
    sys.stdout.flush()
    pass
print k