×
Namespaces

Variants
Actions

Archived:How to compile PySymbian scripts and libraries to bytecode

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.

Article Metadata
Article
Created: lfd (26 Jun 2007)
Last edited: hamishwillee (31 May 2013)

Prerequisite

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).


Compile PySymbian script to bytecode

  • Go to C:\Python22> from the command prompt
  • Type python and you should get 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.
>>>
import py_compile
 
py_compile.compile("\\path\\to\\mymodule.py")

It will result a mymodule.pyc file at the given path.


Compile your PySymbian library to bytecode

  • Go to C:\Python22> from the command prompt
  • Type python and you should get 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.
>>>
import compileall
 
compileall.compile_dir("\\path\\to\\myLibrary\\Directory", force=1)

It will result *.pyc files recursively for each files at the given path including sub-directories, sub-sub-directories...

This page was last modified on 31 May 2013, at 04:03.
40 page views in the last 30 days.
×