[Microbit-Python] MicroPython / web based code editor / BBC request

Michael sparks.m at gmail.com
Tue Jul 14 12:40:44 CEST 2015


Would love to say yes, but I'm not at Europython (wouldn't afford a holiday
with family otherwise), would be interested in hearing any outcome though
:-)

Regards,


Michael.

On 14 July 2015 at 11:16, Nicholas H.Tollervey <ntoll at ntoll.org> wrote:

> Just a thought... since many of us will be at Europython next week,
> perhaps we could get together for a MicroBit BoF and see what happens..?
>
> N.
>
> On 14/07/15 10:36, Nicholas H.Tollervey wrote:
> > Hi Folks,
> >
> > A quick heads up on what's been happening.
> >
> > I saw Howard from the BBC (on this list) yesterday for a couple of
> > hours. As you may have realised the BBC would like to move forward with
> > MicroPython on the device and now have to figure out how to make it
> > happen in a way that complements everything else they're doing.
> >
> > To this end, Howard expressed legitimate concerns about there not being
> > a Python presence in the microbit.co.uk TouchDevelop based site. While
> > it's easy, as engineers, to say, "just use the editor you're used to",
> > the BBC will be pushing the site and, from out Pythonic perspective,
> > there's a chance Python will not get the visibility that it ought to as
> > a result.
> >
> > As Tom H. pointed out on the Sunday hack-day, it would be good to have a
> > Python editor that targeted MicroPython.
> >
> > Howard accepts my point that translating from Python to the TouchDevelop
> > AST is a lost cause: it's hard, it's not documented, there's no
> > community interest and we already have MicroPython that, from a Python
> > perspective, is an obviously superior solution. Interestingly, some
> > brave souls at CodeKingdoms have managed to reverse engineer the TD AST
> > and have created a Javascript -> TD AST editor. I've already asked them
> > if they could share how they got the out-of-date / incomplete
> > microbit.co.uk based code to work so they had a working dev environment.
> >
> > In any case, given the expertise in this group I think it'd be
> > relatively simple to create a *simple* MicroPython editor that could be
> > embedded in the TouchDevelop site. To be clear, we'd need something like
> > PythonAnywhere's ATOM based Python editor that sat within an iFrame
> > within the TouchDevelop site.
> >
> > We can use use TouchDevelop's postMessage API (viz.
> >
> https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage?redirectlocale=en-US&redirectslug=DOM%2Fwindow.postMessage
> )
> > as demoed in the Blockly example we have access to. This would mean
> > users can save their code and share it with each other.
> >
> > Furthermore, instead of a "compile" or "run" button, we can simply
> > create a "save" button that takes the editor's Python text and downloads
> > it to the local filesystem so user's merely have to drag it onto the
> > device. Happily, this can all happen locally via some interesting
> > hackery with Javascript's Blob object and saveAs function:
> >
> > $("#btn-save").click(function() {
> >   var text = $("#python-editor").val();
> >   var filename = $("#input-filename").val()
> >   var blob = new Blob([text], {type: "text/plain;charset=utf-8"});
> >   saveAs(blob, filename+".py");
> > });
> >
> > This means we DO NOT have to build any back-end infrastructure to make
> > this work. We simply have to host the static editor somewhere.
> >
> > Assuming we can get clear instructions from Microsoft on how to set up a
> > development environment that actually bloody works, who would be
> > interested in spending a hack-day in early August to kick this off..?
> >
> > N.
> >
> >
> >
> > _______________________________________________
> > Microbit mailing list
> > Microbit at python.org
> > https://mail.python.org/mailman/listinfo/microbit
> >
>
>
>
> _______________________________________________
> Microbit mailing list
> Microbit at python.org
> https://mail.python.org/mailman/listinfo/microbit
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/mailman/private/microbit/attachments/20150714/f870a3e8/attachment-0001.html>


More information about the Microbit mailing list