Archived:How to do conditionally compile for different PySymbian versions
This PySymbian code snippet demonstrates how to do source code variation for PySymbian 1.4.5 (and earlier) and PySymbian 1.9.0 (and newer). You might want to do code variation, because 1.4.5 is the latest stable release and 1.9.x is the current on-going development project. Differences in your script can be small, so variating source code might be easier, faster and more efficient than writing two different versions.
Note that PySymbian 1.9.x supports only S60 3rd Edition (and later) devices and that its functionality is wider and more uptodate than PySymbian 1.4.5 version. However PySymbian 1.4.5 supports additionally also S60 2nd Edition devices.
if e32.pys60_version_info > (1,9):
# PySymbian 1.9.x and above
# Pys60 1.4.x or below