Python is a wide-ranging language, so you won't have learnt everything about it on the early stages of your course. In this module, we assume fundamentals knowledge, and we go on to cover some of the more advanced features of the language that you'll need as you go on to write larger applications of the type that Python's so well suited to.
This topic is presented on public course
Python Programming
Examples from our training material
| bench.py | Find largest 5 files in or below a directory |
| cli.py | Report on command line parameters |
| cpick | Store an object via cPickle |
| cunpick | recover a pickled object |
| currency.py | Formatting a currency using Regular Expression |
| flist.py | All the files in a directory - which is largest? |
| gad1.py | Create a Gadfly (SQL) database and insert data |
| gad2.py | Running an SQL query - Gadfly |
| get_os.py | Get Operating System information |
| hostfilter.py | Extract host computer information - strip comments with regular expressions |
| mar_in.py | Loading in an object saved via the marshal module |
| mar_out.py | Marshal converts an object to a string |
| myuser.py | class for use in pickle / unpickle demo |
| penv.py | Python environment variables |
| psplit | Splitting at a string v splitting at a regular expression |
| python_mysql_web.py | Python, MySQL, CGI (Web) board |
| re1.py | Regular expression - first example |
| re2.py | Stripping spaces |
| re3.py | Find email addresses in line of text |
| re4.py | Regular expression split over several lines |
| refun | evaluating a net list in EQN format |
| relib.py | Some common regular expressions |
| retest.py | Regular Expression test engine |
| sql1.py | Hello MySQL World in Python |
| sql1a.py | MySQL to Python using MySQLdb |
| syscommand | Running an operating system command in Python |
| timestuff.py | Some time handling |
Opentalk forum discussions related to this topic
Regular expressions findall or splitshufflingSorting a dictionary in PythonPython and SQL the DB API and GadflyPython Sort Order
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
Is Python compiled or interpreted?.
Regular expressions in Python.
Elements of a Python-style regular expression.
Anchors (Assertions).
Literal characters.
Character groups.
Counts.
Alternation.
Grouping.
Modifiers.
Some examples.
Methods available on Python regular expressions.
Some more examples and features of regular expressions.
Some popular regular expressions.
Running Python and system commands from within.
Handling dates and times in Python.
Pickling and shelving.
Accessing the environment from Python.
Talking to SQL databases from Python.
Course links
The following web pages are used as references / examples in this module
[
Link] Python Database Modules
(at http://www.python.org/topics/database/modules.html)
[
Link] SourceForge.net: Project Info - gadfly
(at http://sourceforge.net/projects/gadfly)
[
Link] SourceForge.net: Project Info - MySQL for Python
(at http://sourceforge.net/projects/mysql-python)
We check these links from time to time with a spider written in PHP. Latest full check was on Saturday, 12th June 2004. Titles are extracted from the web pages listed.
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 600 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.