First steps for an interactive micropython ... IPython

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Posts: 196
Joined: Fri Dec 13, 2013 9:25 am

Re: First steps for an interactive micropython ... IPython

Post by torwag » Sun May 24, 2015 6:31 pm


sorry didn't saw the replies for some strange reasons. I will try to pack all together and publish it asap.
I did not come much further. If I could only have the time to do things I like rather then doing things which have a deadline ;)

It was pretty easy to create the micropyhon unix kernel wrapper. I almost plain copied it from the example.
It all comes down to handle pexpect correctly.

I will get all in shape and reward myself this evening to play again with it, as soon as I finished that deadline thing... ;)
All the best

Posts: 31
Joined: Mon Dec 28, 2015 6:19 pm

Re: First steps for an interactive micropython ... IPython

Post by v923z » Wed Dec 28, 2016 11:42 pm

I know that this is a rather old thread, and I would be happy to open a new one, if desired. I only wanted to keep this in context.

I also wanted to have some sort of interactive development environment for the board, and ended up defining a new cell-level magic for ipython. I outlined the details here ... bone.ipynb.

The notebook is interactive in the sense that one can capture data from the board, and one can also execute large chunks of code in a single step. Syntax highlighting and traceback colouring is automatic, since the code is in python anyway. (The traceback and the body of the cell, where the new magic is applied are not coloured properly in the notebook rendered on github, though. I haven't the foggiest idea, why that is so.) Code completion is also implemented for two modules, ustruct, and ujson, and extension is obvious for the rest. And this is where I would like to pose my question and also ask for comments.

1. First, do you think that this is a reliable/viable way of dealing with the problem, or are there other alternatives. I have read this thread, but I think the suggestions are not entirely satisfactory.

2. Second, if so, is there an obvious way of extracting the function signatures and doc strings from the micropython modules? For ustruct and ujson, I simply copied the content of ustruct.rst and ujson.rst, but I am not sure that this is how it should be done.

If there is interest, I would be happy to undertake maintenance of this project and define the "empty" modules necessary for the code inspection to work.

Again, I would really appreciate any comments and insights.


Post Reply