Exercises, examples and other material relating to training module Y201. This module is presented on
Private Courses and
Specially Run Courses only
div class= introsubheads HEAVY DATA EXTRACTION IN PYTHON BR /div
Python s a great language for writing testbed applications - things which start ... http://www.wellho.net/solutions/python-l ... ample.html [longer article] |
import os
import re
import time
import sys
from threading import Thread
"""If you want to test whether a whole series of hosts is
available, pinging each ... http://www.wellho.net/resources/ex.php4?item=y201/kicking [code sample] |
import os
import re
import time
import sys
"""This demonstration program pings 10 IP addresses to check
for responses."""
lifeline = re.compile(r"(\d) ... http://www.wellho.net/resources/ex.php4?item=y201/alive [code sample] |
"""Read the contents of a file, line by line.
Split each line, save the lines into a dictionary
of lists keyed on the first value on the line.
Sort ... http://www.wellho.net/resources/ex.php4?item=y201/sbs [code sample] |
#!/usr/bin/python
"""This is a program which reads a web server access log
file and counts the number of times each browser has
visited, outputting the ... http://www.wellho.net/resources/ex.php4?item=y201/lfan [code sample] |
import re
sepo = re.compile(r'\s+')
topsk = {}
for lyne in open("../../requests.xyz","r").xreadlines():
parts = sepo.split(lyne)
print ... http://www.wellho.net/resources/ex.php4?item=y201/rqsummy [code sample] |
import os
import re
import time
import sys
from threading import Thread
"""Threading demo to test out all 254 possible hosts on a
class C network via ... http://www.wellho.net/resources/ex.php4?item=y201/fastandfull [code sample] |
This module is presented on
Private Courses and
Specially Run Courses only
Examples from our training material
| alive | Pipe to and from a system process |
| fastandfull | Threading - to Ping a complete class C subnet |
| fullrange | Threading to ping 254 IP addresses in parallel batches |
| kicking | Threading example - parallel processing |
| lfan | Demonstration program - many aspects of Python |
| rqsummy | Splitting a line at any white space |
| sbs | Data Munging Example |
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
http://www.training-notes.co.uk.
Topics covered in this module
The os module.
Stat and filecmp modules.
More on the sys module.
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
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. Also
available is the Opentalk
Forum for discussion of technical questions.