Exercises, examples and other material relating to training module Y303. This module is presented on Private Courses
and Specially Run Courses
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 ...
|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]
from subprocess import *
I can run a process and allow ...
|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 ...
|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 ...
|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 ...
|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 ...
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|
Some modules are available for download
as a sample of our material or under an Open Training Notes License
for free download from http://www.training-notes.co.uk
Topics covered in this module
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).
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule
Well House Consultants specialise in training courses in
. We run
throughout the UK (and beyond for longer courses), and
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. Also
available is the Opentalk
Forum for discussion of technical questions.