Training, Open Source computer languages

PerlPythonMySQLTclRubyC & C++LuaJavaTomcatPHPhttpdLinux

Search our site for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Python in an afternoon - a lecture for experienced programmers
Last Friday afternoon I was set a challenge - to present Python in three hours to a group of 20 very experience programmers who, however, knew nothing about this particular language.

The session was in Central London - my directions started off with "Get off the Tube at Oxford Circus", so Londoners will know just how central I mean - so I took First Great Western's Penzance express from Westbury into Paddington. It's great to have power at your seat for laptops these days, though the new airline style seats in second class (oops - standard class!) are a bit tight for working on, and the computer jump horribly when the guy in the seat ahead gets up or flops down.


"Python in a nutshell" - no - that's NOT what I entitled the talk, but I went through the various features that will be mainstream for this group (I had had their applications described to me ahead of time), and I concluded with an example which - in less that 1500 bytes including comments - shows a short and simple use of many of the features os the language.

• Variables and Loops
• Comments
• Lists, Tuples, Dictionary
• Functions, Modules, Object use
• Variable scope
• Documentation Strings
• Regular strings, triple quoted strings and raw strings
• Regular Expressions
• Formatted String Outputs
• File Statuses and File Handling.
• Prompting and reading from STDIN
• Exception handling and error exiting

In some horror, I notice that my example doesn't have a single if statement in it but - hey - I don't think I did too badly in getting so much in to a practical piece of code ... [source code here]

grahamellis$ python lfan
This is a program which reads a web server access log
file and counts the number of times each browser has
visited, outputting the results sorted by the number
of accesses
 
Press return to proceed
Processing 13973 kbytes
     1 pd95215e4.dip.t-dialin.net
     1 cache-ntc-ab01.proxy.aol.com
     1 host-66-81-36-237.rev.o1.com
     1 cache-mtc-al03.proxy.aol.com
[snip]
   306 sjcd-webcache-3.cisco.com
   309 193.116.20.220
   327 crawler10.googlebot.com
   348 crawler14.googlebot.com
   407 ip68-110-77-129.ph.ph.cox.net
   970 82-33-81-221.cable.ubr03.trow.blueyonder.co.uk
Total of 67756 visits from 5048 hosts
grahamellis$


How did the afternoon go? Well - I enjoyed it and my whole audience remained, right through to a quarter past five when I finished. A handful of excellent questions afterwards. And a comment from my contact there, who isn't technical himself and had meetings during the afternoon - "Graham - I came back at about five and looked in through the window. The degree of concentration after three hours from everyone was quite remarkable".
(written 2008-06-01 10:46:16)

 
Associated topics are indexed under
Y101 - Introduction to Python
Y205 - Further uses of Python

Back to
Westonbirt Arboretum Postcode
Previous and next
or
Horse's mouth home
Forward to
Example of OO in Perl

Some other Articles
Checking server performance for PHP generated pages
Slow boot and terminal start on Linux boxes
Factory method example - Perl
Example of OO in Perl
Python in an afternoon - a lecture for experienced programmers
Westonbirt Arboretum Postcode
Equality, sameness and identity - Python
Korn shell - some nuggets
String, Integer, Array, Associative Array - ksh variables
Some useful variables and settings in the Korn Shell
1779 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

© WELL HOUSE CONSULTANTS LTD., 2008: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho