Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/libpty.tex @ 21467:4e35fa5d5708 legacy-trunk
Add documentation for the help() built-in; contributed by Ka-Ping Yee.
This is part of SF patch #494622.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Tue, 18 Dec 2001 16:31:08 +0000 |
| parents | d7864345b1c8 |
| children | 68926d0aad40 |
| rev | line source |
|---|---|
|
11079
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1 \section{\module{pty} --- |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
2 Pseudo-terminal utilities} |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
3 \declaremodule{standard}{pty} |
|
12223
e82e82b3b9ad
Merged changes from the 1.5.2p2 release.
Fred Drake <fdrake@acm.org>
parents:
11079
diff
changeset
|
4 \platform{IRIX, Linux} |
|
11079
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
5 \modulesynopsis{Pseudo-Terminal Handling for SGI and Linux.} |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
6 \moduleauthor{Steen Lumholt}{} |
|
15467
d7864345b1c8
Update Moshe Zadka's email address to one works and might last a while.
Fred Drake <fdrake@acm.org>
parents:
13067
diff
changeset
|
7 \sectionauthor{Moshe Zadka}{moshez@zadka.site.co.il} |
|
11079
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
8 |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
9 |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
10 The \module{pty} module defines operations for handling the |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
11 pseudo-terminal concept: starting another process and being able to |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
12 write to and read from its controlling terminal programmatically. |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
13 |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
14 Because pseudo-terminal handling is highly platform dependant, there |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
15 is code to do it only for SGI and Linux. (The Linux code is supposed |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
16 to work on other platforms, but hasn't been tested yet.) |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
17 |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
18 The \module{pty} module defines the following functions: |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
19 |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
20 \begin{funcdesc}{fork}{} |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
21 Fork. Connect the child's controlling terminal to a pseudo-terminal. |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
22 Return value is \code{(\var{pid}, \var{fd})}. Note that the child |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
23 gets \var{pid} 0, and the \var{fd} is \emph{invalid}. The parent's |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
24 return value is the \var{pid} of the child, and \var{fd} is a file |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
25 descriptor connected to the child's controlling terminal (and also |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
26 to the child's standard input and output. |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
27 \end{funcdesc} |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
28 |
|
13067
a679bdb43fad
Thomas Wouters <thomas@xs4all.net>:
Fred Drake <fdrake@acm.org>
parents:
12223
diff
changeset
|
29 \begin{funcdesc}{openpty}{} |
|
a679bdb43fad
Thomas Wouters <thomas@xs4all.net>:
Fred Drake <fdrake@acm.org>
parents:
12223
diff
changeset
|
30 Open a new pseudo-terminal pair, using \function{os.openpty()} if |
|
a679bdb43fad
Thomas Wouters <thomas@xs4all.net>:
Fred Drake <fdrake@acm.org>
parents:
12223
diff
changeset
|
31 possible, or emulation code for SGI and generic \UNIX{} systems. |
|
a679bdb43fad
Thomas Wouters <thomas@xs4all.net>:
Fred Drake <fdrake@acm.org>
parents:
12223
diff
changeset
|
32 Return a pair of file descriptors \code{(\var{master}, \var{slave})}, |
|
a679bdb43fad
Thomas Wouters <thomas@xs4all.net>:
Fred Drake <fdrake@acm.org>
parents:
12223
diff
changeset
|
33 for the master and the slave end, respectively. |
|
a679bdb43fad
Thomas Wouters <thomas@xs4all.net>:
Fred Drake <fdrake@acm.org>
parents:
12223
diff
changeset
|
34 \end{funcdesc} |
|
a679bdb43fad
Thomas Wouters <thomas@xs4all.net>:
Fred Drake <fdrake@acm.org>
parents:
12223
diff
changeset
|
35 |
|
11079
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
36 \begin{funcdesc}{spawn}{argv\optional{, master_read\optional{, stdin_read}}} |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
37 Spawn a process, and connect its controlling terminal with the current |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
38 process's standard io. This is often used to baffle programs which |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
39 insist on reading from the controlling terminal. |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
40 |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
41 The functions \var{master_read} and \var{stdin_read} should be |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
42 functions which read from a file-descriptor. The defaults try to read |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
43 1024 bytes each time they are called. |
|
87a3935e66aa
pty documentation from Moshe; with small edits.
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
44 \end{funcdesc} |
