我知道如何打开文件,然后用Python预先建立的函数来处理它们。但是 sys.stdin 是如何工作的呢?
for something in sys.stdin:
some stuff here
lines = sys.stdin.readlines()
上述两种对sys.stdin的不同用法有什么区别?它是从哪里读取信息的?是通过键盘,还是仍然要提供一个文件?
|
|
飘逸的作业本 · 設定 AutoML 進行時間序列預測 - ...· 3 月前 · |
|
|
独立的手链 · pytorch保存的pth模型通过onnx转 ...· 1 月前 · |
|
|
无邪的橡皮擦 · python 绘制图中字体怎么加粗 - ...· 1 年前 · |
|
|
玩篮球的火锅 · 日常点滴 - 一抹浅笑 - 博客园· 1 年前 · |
|
|
体贴的仙人掌 · RelativeSource Class ...· 1 年前 · |
|
|
逼格高的小蝌蚪 · 通过websocket和三方平台建立连接后断 ...· 2 年前 · |
|
|
谈吐大方的刺猬 · linux 安装libusb库 - ...· 2 年前 · |