... the listing—to choose
which of the three forms we wanted.
Listing 10–2. Submitting a Form with mechanize
#!/usr/bin/env python
# Foundations of Python Network Programming - Chapter 10 - fetch_mechanize.py ...
#!/usr/bin/env python
# Foundations of Python Network Programming - Chapter 11 - wsgi_app.py
# A simple web application built using the Bottle micro-fram...
... 323
BOOKS FOR PROFESSIONALS BY PROFESSIONALS
®
Foundations of Python Network
Programming
This second edition of Foundations of Python Network Programming targets
Python 2.5 through Python 2.7, ...
Intermediate–Advanced
THE APRESS ROADMAP
Python Algorithms
Pro
Python
Foundations of
Python Network
Programming
Foundations of Agile
Python Develop...
... very large message to one of the servers that we have just designed.
Listing 2–3. Sending a Very Large UDP Packet
#!/usr/bin/env python
# Foundations of Python Network Programming - Chapter 2 ... and Client
#!/usr/bin/env python
# Foundations of Python Network Programming - Chapter 3 - tcp_sixteen.py
# Simple TCP client and server that send and receive 16 octe...
... data after it—to signal that the series of blocks is over.
Listing 5–2. Sending Blocks of Data
#!/usr/bin/env python
# Foundations of Python Network Programming - Chapter 5 - blocks.py
# Sending ... getaddrinfo()to Create and Connect a Socket
#!/usr/bin/env python
# Foundations of Python Network Programming - Chapter 4 - www_ping.py
# Find the WWW service of...
...
CHAPTER 6 ■ TLS AND SSL
96
Listing 6 1. Wrapping a Client Socket with TLS Protection
#!/usr/bin/env python
# Foundations of Python Network Programming - Chapter 6 - sslclient.py
# Using ... periods of time are generally
not very interesting when examining a quick protocol like this.)
Listing 7–4. Tracer for a Python Function
#!/usr/bin/env python
# Foundati...
... the functions live together in recent versions of Python for versions of Pythons older than
2 .6, two of them live in the cgi module instead:
# For Python 2.5 and earlier
>>> from urlparse ...
Listing 8–1. Constants and Functions for the Lancelot Protocol
#!/usr/bin/env python
# Foundations of Python Network Programming - Chapter 8 - squares.py
# Using mem...
... in Python.
Listing 12–12. Using a Character Encoding for a Header
#!/usr/bin/env python
# Foundations of Python Network Programming - Chapter 12 - mime_headers.py
# This program requires Python ... 12– 16 shows a
program that will let you decode and save any component of a MIME message:
Listing 12– 16. Decoding Attachments in a MIME Message
#!/usr/bin/env python
#...
... flags.
CHAPTER 16 ■ TELNET AND SSH
267
Listing 16 2. Shell Supporting Whitespace-Separated Arguments
#!/usr/bin/env python
# Foundations of Python Network Programming - Chapter 16 - shell.py ...
[2590L, 265 2L, 265 3L, 265 4L, 265 5L, 269 9L]
These UIDs can then be the subject of a fetch() command that retrieves the information about
each message that you need in orde...
...
f.quit()
CHAPTER 16 ■ TELNET AND SSH
288
Listing 16 8. Listing a Directory and Fetching Files with SFTP
#!/usr/bin/env python
# Foundations of Python Network Programming - Chapter 16 - sftp.py ... like this:
$ python sftp.py
Transfer of 'messages.1' is at 32 768 /12 860 9 bytes (25.5%)
Transfer of 'messages.1' is at 65 5 36/ 12 860 9 bytes (51...