mirror of
https://github.com/python/cpython.git
synced 2025-11-11 14:44:57 +00:00
Correct the poplib example. Stephan Richter pointed out some problems
with it.
This commit is contained in:
parent
b057dd8efa
commit
aac399b80b
1 changed files with 3 additions and 3 deletions
|
|
@ -119,15 +119,15 @@ Here is a minimal example (without error checking) that opens a
|
||||||
mailbox and retrieves and prints all messages:
|
mailbox and retrieves and prints all messages:
|
||||||
|
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
import getpass, poplib, string
|
import getpass, poplib
|
||||||
|
|
||||||
M = poplib.POP3('localhost')
|
M = poplib.POP3('localhost')
|
||||||
M.user(getpass.getuser())
|
M.user(getpass.getuser())
|
||||||
M.pass(getpass.getpass())
|
M.pass_(getpass.getpass())
|
||||||
numMessages = len(M.list()[1])
|
numMessages = len(M.list()[1])
|
||||||
for i in range(numMessages):
|
for i in range(numMessages):
|
||||||
for j in M.retr(i+1)[1]:
|
for j in M.retr(i+1)[1]:
|
||||||
sys.stdout.write(j)
|
print j
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
|
|
||||||
At the end of the module, there is a test section that contains a more
|
At the end of the module, there is a test section that contains a more
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue