Easy Extend
|
|
|
1. Installation1.1 PrerequisitesFor EasyExtend 3.0 a prior installation of Python 2.5 is required. This is the only Python version currently supported by EasyExtend.1.2 InstallersInstallers for the latest version of EasyExtend can be found here. The Windows just needs to be downloaded and opened. For source distributions in zip or tar.gz format, unpack them and type$ python setup.py install Notice that source distributions for non Win 32 systems compiles and installs an extension module called cyTrail.c based on code written in Cython. This module is optional and serves optimization purposes only. It is not required for running EasyExtend. 1.3 Optional installations1.3.1 psyco
I strongly recommend installing psyco
as well. Psyco is a JIT compiler for Python and it might speed up
lexing/parsing/transformation times by a factor of 3. EasyExtend uses a
decorator that puts certain functions under supervision of psyco when
it is installed. Otherwise the decorator returns just the the
unsupervised functions. |
__________________________________________________________________________________ gallery On Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] __________________________________________________________________________________ gal> gal> def test(a): .... switch a: .... case 0: .... print "nok" .... case 1: .... print "ok" .... else: .... print "default" .... gal> test(0) nok gal> test(1) ok gal> test(2) default gal> quit __________________________________________________________________________________ |
EasyExtend/langlets/gallery/demo.gal |
def
test(a): switch a: case 0: print "nok" case 1: print "ok" else: print "default" if __name__ == '__main__': test(1) |
gal>
import demo gal> demo.test(1) ok |