[Microbit-Python] Can't get MU to run on MACbookAir

Carlos P.A. carlos.p.a.87 at gmail.com
Wed Aug 3 07:18:00 EDT 2016


Hi Robert,

MicroPython is a reimplementation of Python 3 that primarily targets
microcontrollers. It is possible to install Micropython on macOS or Linux,
but for the microbit you run MicroPython directly on the target, not your
PC.

What MU does is pack your Python script together with MicroPython for the
microbit and then loads that into the microbit itself. When you click on
the REPL, that is a connection to the microbit and the code you type and
excute there is sent to the microbit with the results sent back to your
computer.

If you would like to run a Python script on your computer that talks to the
microbit, there is a project called microperi (
https://github.com/JoeGlancy/microperi) that implements a Python module
that replicates the same API that the microbit has. However, please do not
confuse these two different approaches, as the general microbit MicroPython
approach is to run micropython on your microbit, not your PC.

Regards,
Carlos



On 2 August 2016 at 16:35, Robert Humphrey <humphrey.robert at orange.fr>
wrote:

> Thanks for the response.  I find it hard work trying to install Micro
> Python, and thanks for bearing with me.  The attached screen shot is
> typical. It appears that there in’t a library to import.
>
> I followed your link via Pep-8, installed Python 3.6,  installed Active
> tcl 8.6. Ran Python 3.6 and get errors.   I re-tried MU and again it
> appears that there are no libraries to import. Is there a simple way to get
> all this working as I can get Python to work interactively from the net at
> W3. microbit.Pythonanywhere.com <http://microbit.pythonanywhere.com>,
>  but no luck locally.
> Bob
>
>
>
> ote:
>
>
> On 02/08/16 13:37, Robert Humphrey wrote:
>
> I have installed MU from GitHub latest  MU-3  30/07/2016  but it errors
> out on every statement.  What haven’t I loaded?
>
> Op Sys  OSX  El Capitaine
>
> Example code:-
>
>
>
> _______________________________________________
> Microbit mailing list
> Microbit at python.org
> https://mail.python.org/mailman/listinfo/microbit
>
>
> Hi Robert,
>
> Thanks for the feedback.
>
> In future, please just attach the PNG image file rather than sticking
> the screen shot in a PDF - it's just simpler and I don't have to twist
> my neck to see what you're up to (I sprained it trampolining over the
> weekend). :-)
>
> So, I'm trying to work out what exactly you mean. Do you mean that Mu
> has an error in it and crashes OR that Mu is reporting errors for every
> line in your code? Looking at your screenshot, I believe you're
> reporting the latter.
>
> If so, these are not errors!
>
> Rather, they are code quality feedback annotations. Your code probably
> will still work, but it has stylistic problems. For example, I can see
> from lines 5-8 you use a comment "#" without following it with a space
> (to aid readability). If you click on the red arrow next to each line a
> little post-it note will appear to explain why the line has been flagged.
>
> Such code quality checking is advisory! Unless you get syntax errors
> your code will run (although it may still contain bugs because it
> doesn't work as you expect).
>
> If you're interested in the conventions Mu uses for checking the quality
> of your code you should read up on PEP-8 - the style guide for Python
> programming (it's like the style guide newspapers use to guide their
> journalists in writing in an idiomatic and "house" style).
>
> https://www.python.org/dev/peps/pep-0008/
>
> PEP-8 was written by Python's creator Guido van Rossum and a couple of
> other collaborators (including Nick Coghlan, who may be subscribed to
> this list). It's their vision of well written, idiomatic Python. Many
> Python programmers, myself included, use it for guidance when writing code.
>
> You are free to ignore it though. As PEP-8 itself says, "a foolish
> consistency is the hobgoblin of little minds".
>
> :-)
>
> Hope this helps, and more than happy to answer any questions you may have.
>
> 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: <http://mail.python.org/pipermail/microbit/attachments/20160803/9e11e8da/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2016-08-02 at 17.22.06.png
Type: image/png
Size: 729722 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/microbit/attachments/20160803/9e11e8da/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2016-08-02 at 17.29.08.png
Type: image/png
Size: 506063 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/microbit/attachments/20160803/9e11e8da/attachment-0003.png>


More information about the Microbit mailing list