第 7 章 Pipe

简介:

目录

7.1. stdin
7.2. forkpty
7.3. Popen
7.4. socketpair

7.1. stdin

#!/usr/bin/python
#filename:demo.py

import sys

for line in sys.stdin:
    print line,


#ls -lh | python demo.py
		





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
打赏
0
0
0
0
26197
分享
相关文章
已解决 BrokenPipeError: [Errno 32] Broken pipe
已解决 BrokenPipeError: [Errno 32] Broken pipe
7019 0
已解决 BrokenPipeError: [Errno 32] Broken pipe
如何确定 Broken Pipe 异常是由网络问题还是其他原因引起的
Broken Pipe 异常可能由网络问题或其他原因引起。要确定具体原因,可以检查网络连接状态、防火墙设置和系统日志,同时分析异常发生时的上下文信息。
509 5
Signal 13 was raised(SIGPIPE管道破裂)
Signal 13 was raised(SIGPIPE管道破裂)
150 0
av_interleaved_write_frame -32 broken pipe
av_interleaved_write_frame -32 broken pipe
338 0
av_interleaved_write_frame -32 broken pipe
BrokenPipeError: [Errno 32] Broken pipe解决方法
BrokenPipeError: [Errno 32] Broken pipe解决方法
1597 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等