python pty.fork - how does it work

前端 未结 5 1919
执笔经年
执笔经年 2020-12-16 18:46

http://docs.python.org/library/pty.html says -

pty.fork()¶ Fork. Connect the child’s controlling terminal to a pseudo-terminal. Return value is

5条回答
  •  隐瞒了意图╮
    2020-12-16 19:01

    "and fd is a file descriptor connected to the child’s controlling terminal" --> The child process will not see any difference, it will be able to access stdin/out normally (I dont know about stderr). The only difference is that on the other side of the "pipe" is not a terminal where an user is reading/typing, but the parent process which can access is by the returned fd.

提交回复
热议问题