Exercises, examples and other material relating to training module Y303. This module is presented on
Private Courses and
Specially Run Courses only
Background
Python supports many network protocols through libraries such as urllib
and urllib2, and you can also write network programs direct using TCP or
UDP sockets. Associated subjects such as forking, testing read buffers,
pipes and more are also included here.
Articles and tips on this subject | updated |
4087 | Python network programming - new FTP and socket level examples These days, it's the exception rather than the rule to write low level network code within your applications - and during today's Intermediate Python course, I wrote an example showing an FTP connection to retrieve data using ftplib. The first example is [here] - grabbing a file, saving it locally via ... | 2013-05-18 |
2765 | Running operating system commands from your Python program As from Python 2.6, os.popen and friends are deprecated methods and you should use the subprocess module for subprocesses. So that's the way to go if you want to run operating system commands. New example showing this - [here]
Starting with:
from subprocess import *
I can run a process and allow ... | 2010-05-15 |
2695 | TCP v UDP / Client v Server - Python examples Python's socket module makes it easy for you to write your own clients and server ... and yesterday I produced "Hello World" style examples of each on the final day of our Python Programming Course. I'm going to share these examples with you here ... but I'm also going to add a word of caution first ... | 2010-03-26 |
2694 | Multiple processes (forking) in Python What is forking
If you want a process to head off in two different directions, you can fork it. That results in identical copies of the process being created - the original (parent) and the copy (child), each with their own complete set of variables, and program counter, etc.
The clever thing is that ... | 2010-03-25 |
2368 | Python - fresh examples of all the fundamentals Some more new examples in Python - from this week's course.
From my Introduction to Python / simple example to show the power of the language, I present my example that parsed a big data (log) file and counter and sorted by number of accesses the hits from various remote hosts. A long report, ending ... | 2009-08-23 (longer) |
2365 | Counting Words in Python via the web I love writing things in Python - it's a great language for achieving a great deal in a short time. And it works well got Simple CGI scripts.
Today's challenge - to count the number of words (and number of DIFFERENT words) in a piece of text, so give an idea of how much work would be involved in translating ... | 2009-08-19 |
Examples from our training material
browser.py | Demonstration of simple http client (browser) |
ftpgrab | FTP from Python, checking exceptions |
ftpthread | FTP from within a thread and monitoring it |
probo | Reading from a remote host via http as a stream |
read_robots | Reading from a web resource in Python |
server.py | Simple tcp/ip server using sockets |
t2 | Parallel processing with forks |
t3 | pipe and fork - communicating with your children |
table | Basic mechanism of forking |
to_me | Talking direct to a socket |
udp_client.py | UDP client |
udp_server.py | UDP Server |
Background information
Some modules are
available for download as a sample of our material or under an
Open Training Notes License for free download from
[here].
Topics covered in this module
Network Principles.
Sockets, the socket module, clients and servers.
The Select module and non-blocking reads.
Web Clients in Python.
Remote Procedure Calls.
Using Soap from Python.
Other standard protocols such as FTP (ftplib).
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our
Listing and schedule page.
Well House Consultants specialise in training courses in
Ruby,
Lua,
Python,
Perl,
PHP, and
MySQL. We run
Private Courses throughout the UK (and beyond for longer courses), and
Public Courses at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if
you live in a different
country or continent to us.
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre.