Commit 2bef51e3 authored by Raymond Hettinger's avatar Raymond Hettinger

Clean-up example code: remove string module and backticks.

parent 2f5bab45
......@@ -264,7 +264,6 @@ processing of the \rfc{822} headers. In particular, the `To' and
\begin{verbatim}
import smtplib
import string
def prompt(prompt):
return raw_input(prompt).strip()
......@@ -275,7 +274,7 @@ print "Enter message, end with ^D (Unix) or ^Z (Windows):"
# Add the From: and To: headers at the start!
msg = ("From: %s\r\nTo: %s\r\n\r\n"
% (fromaddr, string.join(toaddrs, ", ")))
% (fromaddr, ", ".join(toaddrs)))
while 1:
try:
line = raw_input()
......@@ -285,7 +284,7 @@ while 1:
break
msg = msg + line
print "Message length is " + `len(msg)`
print "Message length is " + repr(len(msg))
server = smtplib.SMTP('localhost')
server.set_debuglevel(1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment