Learning Python Network Programming

(Sean Pound) #1
Preface

[ xiii ]

We also use the Wireshark packet sniffer in several chapters. This will require
a machine where you have root access (or administrator access in Windows).
Wireshark installers and installation instructions are available at https://www.
wireshark.org. An introduction to using Wireshark can be found in the Appendix,
Working with Wireshark.


Who this book is for


If you're a Python developer, or system administrator with Python experience,
and you're looking forward to take your first step in network programming, then
this book is for you. Whether you're working with networks for the first time or
looking to enhance your existing networking and Python skills, you will find this
book very useful.


Conventions


In this book, you will find a number of text styles that distinguish between different
kinds of information. Here are some examples of these styles and an explanation of
their meaning.


Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows:
"IP addresses have been assigned to your computer by running the ip addr or
ipconfig /all command on Windows."


A block of code is set as follows:


import sys, urllib.request

try:
rfc_number = int(sys.argv[1])
except (IndexError, ValueError):
print('Must supply an RFC number as first argument')
sys.exit(2)

template = 'http://www.ietf.org/rfc/rfc{}.txt'
url = template.format(rfc_number)
rfc_raw = urllib.request.urlopen(url).read()
rfc = rfc_raw.decode()
print(rfc)
Free download pdf