473,287 Members | 1,926 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,287 developers and data experts.

Trying out two small Pythons (pymite and tinypy)

kudos
127 Expert 100+
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 microcontrollers. 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:

Expand|Select|Wrap|Line Numbers
  1. ./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:

Expand|Select|Wrap|Line Numbers
  1. ./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 :

Expand|Select|Wrap|Line Numbers
  1. 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:

Expand|Select|Wrap|Line Numbers
  1. python build.py
it runs several test, and explain that you could run python programs like this:

Expand|Select|Wrap|Line Numbers
  1. ./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.
May 12 '20 #1
0 6723

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: ForHimself Every Man | last post by:
What's better about Rattlesnakes than Python. I'm sure there's something. What is it? This is not a troll. I'm a snake shooping and I want people's answers. I don't know beans about...
12
by: Don Bruder | last post by:
A week or two ago, I asked here about porting Python to C. Got some good answers (Note 1) but now I've got another question. Actually, more a request for clarification of a topic that both the...
12
by: f29 | last post by:
I don't believe that noone has yet spotted that python is becoming java. Each new version is fully equipped with more garbage than before. Classes are great, but once there are 1000 of them,...
28
by: robert | last post by:
In very rare cases a program crashes (hard to reproduce) : * several threads work on an object tree with dict's etc. in it. Items are added, deleted, iteration over .keys() ... ). The threads are...
5
by: Mathias Panzenboeck | last post by:
Hi. I wrote a small hashlib for C. Because I'm new to hashes I looked at pythons implementation and reused *some* of the code... or more the mathematical "hash-function", not really the code. ...
1
by: tedpottel | last post by:
Hi, I am creating a library of functions. I would like to have them saved in a sub folder of pythons LIB folder, but I cannot get it to work. I have a script called test.py I stored it in...
14
by: rtk | last post by:
I'm looking for information on building a tiny/small/minimalist/ vanilla python interpreter. One that implements the core language and a few of the key modules but isn't tied to any specific...
6
by: tedpottel | last post by:
Hi, I'm trying to create my own lib of functions, but it seems like I can only import them if they are in pythons lib folder. Example I have a folder called K:\mypython Now in the...
2
by: tedpottel | last post by:
Hi, Is their a version of pythons IDLE that will run in a dos command line? The reason is that I would like to be able to run python code interactively from my parable by connecting to my desktop...
0
kudos
by: kudos | last post by:
Yesterday, I checked out sculpt (http://www.skulpt.org/) which turned out to be an online python interpreter written (or compiled?) to JavaScript. There are other examples, but the way sculpt...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.