473,513 Members | 2,658 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying out two small Pythons (pymite and tinypy)

kudos
127 Recognized Expert New Member
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 6764

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

Similar topics

9
2507
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
2817
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
1646
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
7335
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
2163
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
1409
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
5585
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
2001
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
2788
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
6310
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
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5084
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.