OpenWrt Forum Archive

Topic: Micro Python (a tiny version of Python 3.4) is now in trunk

The content of this topic has been archived on 25 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

You should be able to install it with "opkg install micropython" if you're running trunk or just manually download and install the package. It requires about 250 KB of storage or ~110 KB if you roll your own image.

Note that it's a bare minimum implementation  of Python 3.4 and doesn't include the standard library. However there's also a package called micropython-lib that implements a very small subset.

It was added about a week ago and could use some testing. Would also be great to see some OpenWrt-specific applications.

(Last edited by roger_ on 25 Aug 2014, 20:50)

Awesome work, I've been wanting something a little lighter on OpenWRT than python.
Is there any information on which bits are implemented?

adamm wrote:

Awesome work, I've been wanting something a little lighter on OpenWRT than python.
Is there any information on which bits are implemented?

Should be the complete MicroPython (except for Viper).

@roger_

This is exactly what I am looking for!
I want to porting some libraries for micro python, is there any guide that i can refer to?

Not that I'm aware of, but you can use the FFI library that's built in.

Good idea, thanks! Would be good to mention micropython-lib too BTW.

What is micropython-lib used for?

It's a small (but incomplete) version of the Python stdlib.

Wiki page has really progressed nicely, thanks to all contributors and others please if you have something to add or improve please do so: http://wiki.openwrt.org/doc/software/python

I have a problem with uPy on openwrt, i find a md5 implementation like this :http://pastebin.com/FKHY1XY2. It work well on pc's uPy, but the uPy on openwrt throw "assertion `0' failed." or "NotImplementedError: bignum or with negative args".How can i figure out the problem?

fuyumi wrote:

I have a problem with uPy on openwrt, i find a md5 implementation like this :http://pastebin.com/FKHY1XY2. It work well on pc's uPy, but the uPy on openwrt throw "assertion `0' failed." or "NotImplementedError: bignum or with negative args".How can i figure out the problem?

You might want to create a new issue here: https://github.com/micropython/micropython/issues/new

Be sure to mention what platform and MicroPython version you're using.

(Last edited by roger_ on 19 Oct 2015, 17:28)

The discussion might have continued from here.