Trying out two small Pythons (pymite and tinypy)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kudos
    Recognized Expert New Member
    • Jul 2006
    • 127

    Trying out two small Pythons (pymite and tinypy)

    I have built two very small pythons (pymite and tinypy) where one is not maintained anymore. The following summarises the experience.

    pymite

    I found the most recent version : https://github.com/dwhall/p14p

    It is a Python for microcontroller s. I don't have one, so I will build it for my Windows 10, with an Ubuntu installed from Microsoft store.

    I downloaded the archive as a zip file, unzip it into the directory p14p-master. I type 'make' to build it.

    I get some error about comparing pointer to int. To fix this, I locate -Werror in the Makefile

    pymite requires Python 2.6 (the project have been inactive for some time). I don't want to replace my existing Python with Python 2.6 by installing it, therefore I download Python 2.6 from the source: https://www.python.org/downloads/ and place it in the newly unpacked p14p-master directory

    I unpack it, go into the directory, then type:

    Code:
    ./configure & make.
    I note the location of my newly built python.exe file, i.e., /p14p-master/python2.6/python.exe, then I go into each of the python files in the tools directory and replace #!/usr/bin/env python with /p14p-master/python2.6/python.exe in each .py file in the pymite project. I type make, go to the directory in p14-master/src/tools/ and type:

    Code:
    ./ipm.py -f ../platform/desktop64/pmfeatures.py -d
    Now you could type: print "hello world"

    it is a bit annoying to type stuff directly to stdin, so if we have a python file, say "test1.py" with a python program, you could type :

    Code:
    load test1.py
    from within pymite to load and execute the test1.py.

    It seems that it doesn't contain a parser and takes the bytecodes from my python 2.6 program (i.e., the .pyc) file and execute them so one could argue that pymite is more a virtual machine.

    tinypy

    It can be found here:http://www.tinypy.org/downloads.html

    build it by downloading the zip file, unzip it, then type:

    Code:
    python build.py
    it runs several test, and explain that you could run python programs like this:

    Code:
    ./tinypy <your program>
    (it doesn't seem to allow you to type in directly into stdin, so you need to store your program into a file)

    A statement such as print "hello world", doesn't output anything, however changing it to print("hello world") does. So I guess tinypy was more inspired by Python 3, while pymite was inspired by Python 2.
Working...