File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/local/bin/python
2+
3+ # This Python program sorts and reformats the table of keywords in ref2.tex
4+
5+ import string
6+ l = []
7+ try :
8+ while 1 :
9+ l = l + string .split (raw_input ())
10+ except EOFError :
11+ pass
12+ l .sort ()
13+ for x in l [:]:
14+ while l .count (x ) > 1 : l .remove (x )
15+ ncols = 5
16+ nrows = (len (l )+ ncols - 1 )/ ncols
17+ for i in range (nrows ):
18+ for j in range (i , len (l ), nrows ):
19+ print string .ljust (l [j ], 10 ),
20+ print
Original file line number Diff line number Diff line change @@ -193,13 +193,13 @@ \subsection{Socket Object Methods}
193193
194194\begin {funcdesc }{send}{string}
195195Send data to the socket. The socket must be connected to a remote
196- socket.
196+ socket. Return the number of bytes sent.
197197\end {funcdesc }
198198
199199\begin {funcdesc }{sendto}{string\, address}
200200Send data to the socket. The socket should not be connected to a
201201remote socket, since the destination socket is specified by
202- \code {address}.
202+ \code {address}. Return the number of bytes sent.
203203(The format of \var {address} depends on the address family -- see above.)
204204\end {funcdesc }
205205
Original file line number Diff line number Diff line change @@ -130,6 +130,12 @@ \section{Standard Module \sectcode{string}}
130130not found.
131131\end {funcdesc }
132132
133+ \begin {funcdesc }{count}{s\, sub\, i}
134+ Return the number of (non-overlapping) occurrences of substring
135+ \var {sub} in string \var {s} with index at least \var {i}.
136+ If \var {i} is omitted, it defaults to \code {0}.
137+ \end {funcdesc }
138+
133139\begin {funcdesc }{lower}{s}
134140Convert letters to lower case.
135141\end {funcdesc }
Original file line number Diff line number Diff line change @@ -193,13 +193,13 @@ \subsection{Socket Object Methods}
193193
194194\begin {funcdesc }{send}{string}
195195Send data to the socket. The socket must be connected to a remote
196- socket.
196+ socket. Return the number of bytes sent.
197197\end {funcdesc }
198198
199199\begin {funcdesc }{sendto}{string\, address}
200200Send data to the socket. The socket should not be connected to a
201201remote socket, since the destination socket is specified by
202- \code {address}.
202+ \code {address}. Return the number of bytes sent.
203203(The format of \var {address} depends on the address family -- see above.)
204204\end {funcdesc }
205205
Original file line number Diff line number Diff line change @@ -130,6 +130,12 @@ \section{Standard Module \sectcode{string}}
130130not found.
131131\end {funcdesc }
132132
133+ \begin {funcdesc }{count}{s\, sub\, i}
134+ Return the number of (non-overlapping) occurrences of substring
135+ \var {sub} in string \var {s} with index at least \var {i}.
136+ If \var {i} is omitted, it defaults to \code {0}.
137+ \end {funcdesc }
138+
133139\begin {funcdesc }{lower}{s}
134140Convert letters to lower case.
135141\end {funcdesc }
Original file line number Diff line number Diff line change 1+ #! /usr/local/bin/python
2+
3+ # This Python program sorts and reformats the table of keywords in ref2.tex
4+
5+ import string
6+ l = []
7+ try :
8+ while 1 :
9+ l = l + string .split (raw_input ())
10+ except EOFError :
11+ pass
12+ l .sort ()
13+ for x in l [:]:
14+ while l .count (x ) > 1 : l .remove (x )
15+ ncols = 5
16+ nrows = (len (l )+ ncols - 1 )/ ncols
17+ for i in range (nrows ):
18+ for j in range (i , len (l ), nrows ):
19+ print string .ljust (l [j ], 10 ),
20+ print
You can’t perform that action at this time.
0 commit comments