Python Framework for Symbian Series 60 phones

Sunday 8 April 2007

Compile PyS60 script to bytecode

Follow the previous post instructions if you don't have Python 2.2.2 installed on your system.

import py_compile
 
py_compile.compile("mymodule.py")

Compile your PyS60 library to bytecode

First of all you need to install python 2.2.2 on your machine. It can be downloaded at http://www.python.org/download/releases/2.2.2/

I kept the installation folder by default (C:\>Python22) in order not to interfere with my current Python 2.5 installation (installed in C:\>Python).

Then

  • go to C:\Python22>
  • type python and you should have the following output:
Python 2.2.2 (#37, Oct 14 2002, 17:02:34) \[MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

All you have left to do is:

import compileall
 
compileall.compile_dir("myLibDirectory", force=1)

LEFEVRE Damien
http://www.lfdm.net
contact@lfdm.net