Locked History Attachments All Actions

MeetingsAuckland/October2009

NZPUG Meeting - October 2009

When: Wednesday, 21 Date 2009, 18.30 - 20:00 - please be on time

Where: Engineering Building (Bldg. 403, see map), UoA, Symonds St., Auckland - Room 403.401 aka 3.401

Agenda

This time we'll have a nice and refreshing SOYSS session ("Show Off Your Small Stuff"). It should contain of things like Lightning Talks, quick demos, rants, "pimp my script" sessions, ...

Some proposed ideas:

Notes

multiprocessing.Pool talk

A very brief introduction towards what's possible very easily to utilise multiple cores/CPUs through Python's "batteries included" concept using a Pool object to batch queue jobs for a number of automatically managed worker processes.

Notes:

  • Code of the submitted/parallelised function, calling parameters (objects) as well as returned structures are all serialised (pickled) and transmitted transparently for the user's ease
  • To pickle a function (code), the function cannot be a method of an object

  • The Pool constructor automatically creates as many workers as local CPUs/cores are available, but that can be influenced

  • This was just an appetiser, there's much more to it, read the documentation for the full blow ...

import mania

A quick description how one can alter the import path to make packages/modules accessible on the file system. Includes these:

  • PYHTHONPATH environment variable

  • sys.path variable in the Python runtime

  • file system hierarchy and module accessibility inside (site-/dist-packages, local packages, magic of the __init__.py file, ...)

  • using .pth files

  • using setup.py and doing the Packaging Mambo (.deb files, eggs/PyPI packages, ...)

In conclusion after some discussion in the meeting I have decided that the python import statement is not about the file system. This is why it is impossible to give it a filename to import. The import statement is about importing a namespace into your code. The question then becomes how does python find your module to import the namespace. In this case setup.py is the proper way to do things. Use

$python setup.py develop

to make the your modules visible to python and use buildout or virtualenv to sandbox your developement environment from your actual python installation.

Teaching Python to an 11 year old

Some thoughts on the experiences of seeing an 11-year-old interested in Python, and how to teach him. Elliot, the boy in question, was present.

  • uninhibited and playful approach to learning a programming language
  • no fear to break something
  • bizzareness of child thinking in package naming (e. g. "from time import sleep as zzz")

Teaching Python to University students

A recap on a few semesters of teaching/dealing with Python and university students at the University of Auckland. Particularly software engineers, electrical engineers, and postgraduate students. Very interesting to see the individual strengths/weaknesses of the different majors, particularly to various programming paradigms (OO, functional, list comprehension, dynamic vs. static languages, ...)


CategoryAucklandMeetings