I recently had the great pleasure of visiting Wollaston School to see Steve Foster use Mu in his classroom. Here he is in action, in perhaps the most “teacher-ish” photograph you’ll see for a long time:
This wasn’t my first visit to see Steve. He very kindly allowed me to observe his lessons back in 2017 when I was researching how learners and teachers engage with software development tools. His was the first of several schools and code clubs I visited for this purpose and, in addition to observing lessons, I interviewed him and some of his colleagues. In fact, it was as a direct result of chatting with the network administrators at Steve’s school that so much effort was put into making Mu easy to install. I was very pleased to hear that the very same network administrators had easily managed to install Mu on the computers in Steve’s classroom.
Achievement unlocked! :-)
On this visit I observed two lessons: a year 10 GCSE class (students turn 15 during year 10, and GCSE is the examination all students take at age 16), and a year 9 computing lesson (students turn 14 in year 9 and decide their “options” [which GCSE courses to take] during this academic year).
Both classes were exceptionally well behaved and engaged and the students were friendly and enthusiastic to learn. They’re a credit to themselves, Steve and their school.
I was simply introduced to the students as “Nicholas - a software developer” and played the role of a teaching assistant. This prompted a sense of nostalgia for me. Having students say, “Sir, I’m stuck on this problem” made me remember my time as a secondary head of music all those years ago and it was fun to collaborate with and support young people in their learning. There are some aspects of teaching which are extraordinarily rewarding and a privilege to experience – this was one such an occasion.
The students in year 10 knew what they were up to and were already familiar with Mu. It was good to see them use the editor with such fluency ~ to the extent that they were concentrating on their coding problem rather than getting side-tracked by their development environment. The first time I visited the school, I seem to remember students using some sort of online Python tool and I spent much of my time trying to help them fix the odd state into which they had got themselves. I also had a great sense of satisfaction when I saw how many of them were using the “Check” button to report potential problems with their code. They told me they found this especially useful when they ran their code and ended up with a syntax error. The “Check” button visually points out the problematic line and describes the problem. Far better than wading through terse computer-ese.
The year 9 class was especially enjoyable since I was watching their first encounter with Mu. In the previous academic year (before Mu 1.0 was released) they had been using IDLE as a development environment. Being able to observe their first contact with Mu was an amazing opportunity.
I wasn’t disappointed.
Steve started the lesson by introducing Mu as a new Python editor and then gave the class a few minutes to poke around with it before asking them to report back on what they’d discovered.
Within seconds, one of them had found the “Theme” button and toggled through to “night” mode. This was followed by a hilarious few seconds of excited whispering as the students all tried to turn their Mu editor into “night” mode. Within about a minute, everyone had “night” mode enabled and the class were feeling suitably “Hollywood hacker-ish”.
Some kids found the “Check” button while others enjoyed zooming in and out to extreme magnifications of their code. Most importantly, the feedback seemed positive and the students enjoyed playing with Mu (yes, “playing” is perhaps the right word).
Steve then asked them to “code along” a Magic 8 Ball script. Steve would explain some code and demonstrate it working, then ask the kids to type it in and check their version was working. After that, he’d repeatedly add more features, while giving the students an opportunity to ask questions, until the program was finished. This is exactly what Steve is doing in the photograph at the top of this blog post.
This activity was particularly fun since the students could define their own mysterious sounding Yes/No answers for the “magic 8 ball”. In a very teenager-y turn of events, one student cast their answers totally in the context of resolving relationship problems. Again, Mu didn’t cause any issues and the students could simply concentrate on customising their script.
At the end of both lessons I was given 10 minutes to tell the students a little bit about what I do as a software developer and enjoyed answering their questions. When Steve revealed I was the creator and maintainer of Mu, the year 9 class gave me a round of applause (after one girl started clapping loudly on her own, and then shouted to the rest of the class something along the lines of, “Give this guy some respect won’t ya..?”).
After the lessons Steve and I spent some time together in an interview / de-brief session. He provided more context about how Mu was used in his lessons and all the feedback I have received, be it from teacher or students, will find its way into improvements in the next version of Mu.
If you are a teacher using Mu in your classroom, please don’t hesitate to get in touch. We’d love to hear how you’re getting on and learn about the ways we can improve your own and your students’ experience of learning to program in Python.
Thanks to Steve and his students for giving me the rewarding experience of seeing Mu used in “real world” learning situations. Keep up the great work! :-)
Last week was PyWeek, where entrants have a week to make a game on a given theme using Python. Myself and my buddy Andrew Smith decided to form a team called Code to Joy and write something using Mu and PyGameZero. At the start of the week the theme was revealed as “flow”. We ended up creating “Traffic Flowmageddon” with gameplay like 80’s classic Frogger, a look similar to the 90’s classic Grand Theft Auto and with a dash of Shaun of the Dead thrown in for some timely Halloween spice. The opening screen pretty much sums up the character of the game:
It was fun to work in a team. I mainly concentrated on the code and Andrew spent time on the sound effects and music. The graphical assets were either bodged together by us or were free-to-use downloads from the internet. What was particularly pleasing was how quickly we were able to put together the scaffolding of the game in a very short period of time and just under 100 lines of Python:
Yes, that’s quite an abstract looking game (none of the graphical assets had been created), but the labelled boxes and fact that stuff is moving around demonstrated the core of the game worked well. Having said that, simply adding some proper graphics and an animation on the hero sprite that the player controls makes a huge difference! It actually looks like a game:
At this point in the development of the game, one of us had the idea of adding zombies and, since I’d been tweeting about our progress, we were getting suggestions for other features from friends (such as potholes in the road which would slow you down, or drivers with no lane discipline).
The zombies make a big difference since they force you off the pavement and into the flow of traffic.
In the meantime, Andrew had been putting together music and sound effects as well as the code to load and play them at the appropriate moments in the game. This was especially rewarding to hear since sound and music add so much to the atmosphere. Andrew found some appropriately spooky sounding music, a “happy tune” to play when the game completed and a whole host of sounds for the zombies and traffic (for example, if you get too close to one of the London taxi cabs, the driver will shout at you).
As the video shows, the finished game works quite well for something cobbled together in just a week. Most importantly, it’s all done with Mu and PyGameZero in around 400 lines of Python.
I’d heartily recommend anyone participate in future PyWeeks. The organiser, Dan Pope (who also created PyGameZero) has done a fantastic job of creating such a fun competition with a community of coders creating such joyously goofy games.
Long may it last!
Thanks to the efforts of volunteer teachers, young Chinese students are using Mu to learn Python.
My Chinese friend explains,
“I am a programmer in Hefei China, my colleagues and I give Python classes to more than 20 children every Tuesday afternoon. (A total of 14 weeks.)
This is a course of interest for the students who is interesting with programming, it’s free and we are volunteers. We have a plan to teach Python, from the base to the high, not that high.”
He goes on to explain how learning to code is making a big impression of some of his students and their families.
“The little boy in the [following] photo inspired me, he is very clever and he can answer almost every problem in class.
This boy father is so seriously to this class, he find a app which can coding in iphone, and he learn it himself to teach his son after school.
My first baby is coming soon, I think may be I should learn from him, you know he has no experience in programming and in his daily job there is no computer in front of him. Father’s love is great and will drive us to do many things. One father is more than a hundred schoolmasters.”
I have to admit that I was deeply moved by this explanation. I was also amazed to see that the teachers and students use a sort of chat app for sharing and marking homework.
It makes me extraordinarily happy to know that our collective efforts in translating Mu for learners who don’t have English as a first language are paying off. I’d like to applaud the efforts of the volunteer teachers in China who are helping to nurture the next generation of Python programmers. Finally, I would like to wish their students (and parents!) the very best of luck when learning to use Python. You are learning a skill that will help you flourish in our modern technological world. Please keep up your efforts and, if you have time, keep sharing what you have been doing. Perhaps, in the future, you will speak at PyCon China.
I’m struck by how similar programming is to another passion of mine: music. Both are cross cultural and international endeavours. By sharing our code, learning from each other and telling stories of programming we bring our world closer together.
My Chinese friend ends by saying,
“Thank you for your work, Mu is so cool, Mu is best for us.”
I’m so pleased you think so! Thank you!
This second guest post, from Thierry Chantier, describes how the French Python community is helping young programmers with Mu. I’m especially pleased that he’s submitted his blog in French. We love to celebrate the efforts of Mu users all over the world!
It’s a common cliché: french are not good english speakers. But hey, micro:bit, Monthy Python … and Mu comes from the UK, we have to deal with it. (Oh, I forgot the Sex Pistols) The rest of this article will be in french, but that won’t be a problem, you are all french fluent, aren’t you? ;) If Nicholas need some training, I know how to organize something in may 2019 in Lyon :)
Tout d’abord, je me présente : Thierry, aka titimoby sur Internet depuis déjà quelques années. Même si je suis également passionné de musique en fréquences basses, je suis pour ma part tombé dans la marmite informatique dès le plus jeune âge.
D’ailleurs, mon premier rêve de geek fut l’achat d’un ZX Spectrum+, cette merveille elle aussi issue des terres anglaises. Toujours est il qu’après un parcours dont cet article n’est pas le sujet, je me suis un jour retrouvé après une keynote de la conférence MixIT à me lancer dans une association pour les enfants.
MixTeen est née de cette passion pour tout cet univers numérique (en français, digital concerne l’usage des doigts ;)) Nous sommes donc une petite équipe qui essayons d’organiser des ateliers de découverte. Les premiers pas se sont fait en utilisant Scratch, puis au fur et à mesure, tout ce que nous nous sentions d’utiliser. Rapidement, l’envie de lier cette découverte du code au monde physique s’est faite sentir.
Comme j’ai pris goût au monde des makers, comme quelques petits bricolages par ici ou par là c’est avec joie que j’ai vu apparaître la carte micro:bit Très vite, cette carte ou de celles de chez Adafruit sont devenues des invitées permanentes de nos ateliers. En parallèle, certains enfants que nous rencontrons reviennent, grandissent et souhaitent aller plus loin avec Python. Le souci est alors d’avoir des outils suffisamment simples à installer et à utiliser, si possible sans connexion à Internet.
L’apparition de Mu semble répondre à tous ces critères et on lui fait une place dorénavant. La gestion des cartes micro:bit est très sympa et la découverte de python me semble plus claire avec Mu.
Les pythonistas de la PyconFR ont d’ailleurs bien aimé Mu. Cette fois là, en plus des enfants, nous nous sommes retrouver à initier des parents et c’était un très bon moment.
Il ne manque plus qu’une fonction de selfie dans Mu pour avoir des photos de bonne qualité, je suis généralement trop occupé pour pouvoir faire une photo qui ne soit pas floue ;)
En attendant, nous continuerons d’aider à traduire Mu (ou les ressources de la fondation Raspberry, on est très ouverts)
Et comme le disent les Girls Can Code! :
“ALLEZ MU !”
It’s a quick summary of all that’s been happening in the world of embedded Python. Fun facts revealed in the show include such nuggets as the number of pages of projects, tutorials and how-tos about CircuitPython on the Adafruit website as well as the number of drivers for different devices compatible with CircuitPython. The numbers quoted show the growing momentum behind Python on embedded devices. This is good news!
It was also great to see two Mu contributors (Radomir and Josh) have their work featured. Radomir’s inventive hardware hacking is a thing of wonder, while Josh’s work on the EduBlocks project is, quite simply, inspiring stuff (especially when you consider he’s only 14 years old!).
Finally, Limor, Phil and the wider CircuitPython team at Adafruit deserve kudos and all sorts of accolades for their amazing work building such a welcoming, dynamic and creative community around CircuitPython. As the project tag-line says, “Code + Community = CircuitPython”. Thank you for all the work you do!
Fellow MU-tant (geddit?) Les Pounder, has a stonking project for Halloween trick-or-treating, made with an Adafruit Circuit Playground Express board, CircuitPython and Mu. It’s too cool not to re-blog! The video below shows you all you need to know.
Regular readers will know that Les’s projects are fun, playful, cheap to build and easy to assemble. Furthermore, not only has Les a gift for thinking up such stonking project ideas, but he’s a virtuoso mentor when it comes to explaining how to recreate such projects for yourself. Where am I going with this?
If you are a teacher, Les’s blog is a GOLDMINE of ideas, resources and projects for use in your own classroom.
In this case, the parts are all from PoundLand (no relation), and the digital assets are an audio file and the following short Python script:
import audioio import board from digitalio import DigitalInOut, Direction, Pull # enable the speaker spkrenable = DigitalInOut(board.SPEAKER_ENABLE) spkrenable.direction = Direction.OUTPUT spkrenable.value = True # make the input trigger trigger = DigitalInOut(board.A1) trigger.direction = Direction.INPUT trigger.pull = Pull.DOWN #Create a function to play audio files. def play_file(filename): print("Playing file: " + filename) wave_file = open(filename, "rb") with audioio.WaveFile(wave_file) as wave: with audioio.AudioOut(board.A0) as audio: audio.play(wave) while audio.playing: pass print("Finished") #Main Loop, press a button...make noise! while True: if trigger.value: play_file("sound.wav")
What are you waiting for?
Check out Girls can Code!, programming workshops for girls based in France. Guess what? They use Mu!
I was contacted by Antoine Pietri, one of the organisers of the event, who tells me,
We decided to use Micro:bits with MicroPython for this edition, in the Paris and Lyon camps, so I naturally thought of using the Mu editor and its Micro:bit mode for that. I followed the development of Mu in the last couple of years and saw it slowly grow into a fully-fledged general purpose editor, so I suggested that we use it for the whole camp.
We were thrilled at how easy and useful it was as a learning tool for all our activities, ranging from Hello World to writing games with PyGame. We will definitely use it in the future, probably even when teaching to more experimented students.
This is great to hear. Back in 2017 I was invited to give a keynote address at PyParis. It proved to be a fruitful trip: not only was the conference a wonderful experience and I made lots of new friends, but I was able to meet French computing educators like Antoine.
This proved to be a key moment in the development of Mu as I was able to gather feedback from users for whom English is an additional language. Our discussions led to the following conclusion about non-English speaking learners: the biggest barrier to learning Python isn’t that its keywords are in English, but that the tools and resources for programming in Python are.
Put simply, “je voudrais Mu en français”.
Upon my return to the UK, I immediately investigated Python’s robust capabilities in internationalisation (also known as “i18n”) and this has led to Mu being available in ten human languages (including French) with more on the way.
I hope you’ll be hearing more about Mu’s use in a French speaking context very soon. I also welcome non-English contributions to this blog too. Mu is definitely cosmopolitan in outlook and we want to encourage and help beginner programmers no matter their native tongue. If you have a story to tell about how you use Mu in your own region and language, please don’t hesitate to get in touch.
The source code and documentation for the library Limor demonstrates can be found on GitHub. Under the hood, it’s an I2C based API which has beed abstracted into something Pythonic. The code example included in the README (reproduced below) demonstrates how easy it is to use the LIDAR sensor with CircuitPython. In only a few lines of code it outputs data which Mu can use with its built-in plotter:
import time import board import busio import adafruit_lidarlite # Create library object using our Bus I2C port i2c = busio.I2C(board.SCL, board.SDA) # Default configuration, with only i2c wires sensor = adafruit_lidarlite.LIDARLite(i2c) while True: try: # We print tuples so you can plot with Mu Plotter print((sensor.distance,)) except RuntimeError as e: # If we get a reading error, just print it and keep truckin' print(e) time.sleep(0.01) # you can remove this for ultra-fast measurements!
It’s at this point in geeky blog posts that it’s traditional to bring up sharks, lasers and Dr.Evil. Happily, I ironically understand apophasis. ;-)
(In this guest post, 14 year old Mu user and wunderkind Josh Lowe explains how to get Mu working on locked-down school computers running Windows. School network admins are going to go nuts over this!)
I’ve been using Mu since it was just an editor for MicroPython on the BBC micro:bit. I find myself using it nearly every day because it removes all the features I don’t need and keeps the ones I do need, in a simple layout. So when I started my GCSE Computer Science course, with the first topic being Python Programming, I instantly wanted to use Mu in class.
Unfortunately it’s not: if you’ve ever worked in a school, you’ll know about the hassle of getting stuff installed on school computers, it’s not easy at all. Even if it’s an educational program like Mu (that’s going to benefit students) there are tons of hurdles to jump over to get in touch with the people who do that sort of thing. This looked like the end of the line for me using Mu in class.
I needed to come up with a solution.
So, with a bit of thinking about how I could tackle the issue, the solution came to me. Why not install Mu on a pendrive?
Unfortunately the computers at school are locked down so there is no command prompt, you can’t use
exefiles or use installers that require admin privileges. School rules banned me from downloading Mu onto a pendrive. So I had to find another way to install Mu on my pendrive.
Easy, I did it at home! ;-)
I’d like to introduce PortaMu, my solution to running Mu anywhere. I’ve also put Mu into a zip file so that you only need download and extract it without having to go through all the steps I explain below.
How did I get Mu to install and run on the pendrive?
Firstly, I had to install Mu on the pendrive. This is a very simple thing to do: when you run the Mu installer, select the installation path as your pendrive.
Once installed I faced an issue when I got to school to test it out: when Windows detects a drive it assigns a letter (e.g.
F:) and this can change when you plug the pendrive into another computer. I had to keep changing the shortcut properties each time, and it became a pain. So instead of launching Mu from a shortcut, I created a simple BATCH file that ran everything needed to launch Mu and this works perfectly.
Really? Does Mu actually work? Is that it?
Yes! You get the full Mu experience. I’ve been using it in class for about a week and it’s working really well. It’s grabbed lots of people’s attention who have been using IDLE in class and they’re now starting to use Mu instead!
How can I get my hands on PortaMu?
I’ve uploaded the zip files for people to use, and they’re available in the PortaMu section of Mu’s download page.
It’s just a case of downloading the zip and extracting it onto the pendrive. Once you’ve done that, double click the Launch Mu file and a window will pop up and you’ll see Mu load, it may take some time depending on how quick your computer is.
I hope you find PortaMu useful, just like I have. It’s not only handy for schools but PortaMu can go anywhere with you, whether that be a friend’s house or a library computer.
Why not download it and share the power of Mu with even more people who maybe can’t install things on their computer!
I wrote my first game as an entry for the last PyWeek, and came a respectable 8th out of 23. I was able to use Mu’s PyGameZero mode to quickly create something goofy yet fun. My starting point was the easy to follow PyGameZero tutorial. I like to think it amateur, rather than amateurish:
It was a huge amount of fun, the community involved is friendly and supportive and I’d like to encourage as many people to enter for the upcoming competition.
The PyWeek challenge:
- Invites entrants to write a game in one week from scratch either as an individual or in a team,
- Is intended to be challenging and fun,
- Will hopefully increase the public body of game tools, code and expertise,
- Will let a lot of people actually finish a game, and
- May inspire new projects (with ready made teams!)
Entries must be developed in Python during the challenge, and must incorporate some theme decided at the start of the challenge.
The latest version of Mu is here! Version 1.0.1 is a bug-fix release and all but one of the thirty or more contributions, changes and fixes were made by members of our community. I’m especially proud that this update means Mu supports the following translations: German, Spanish, French, Japanese, Polish, Portuguese (including Brasil), Swedish, Vietnamese and Chinese. Apparently there are Greek and Turkish translations on the way.
We expect the next version of Mu with new features (Python 3.7, some new modes, improvements to configuration, more bug fixes and better translations) to arrive some-time towards the end of this year.
If you spot any bugs, please don’t hesitate to let us know.
Once again, many thanks to all the people in our community who have made such important and helpful contributions: René Raab, Limor Fried, GitHub user @doanminhdang, Martin Dybdal, René Dudfield, Marco A L Barbosa, Justin Riley, Filip Korling, Nick Morrott, John Guan, Filip Kłębczyk, Tim McCurrach, Damien George, Zander Brown, Carlos Pereira Atencio and Tim Golden.
Sign up for free for the second ever Mu-moot! Thursday October 18th at 6pm in the offices of Kano at 3 Finsbury Ave, London, EC2M 2PA. It’s a friendly and supportive meeting for learners, teachers and software developers interested in computing, mentoring, technology, pedagogy, programming and education. While Mu provides a focus for our meetings we are not limited to Mu related activities, discussions or presentations. Rather, Mu-moot is a place to encounter new ideas, share knowledge and meet a diverse group of like-minded people.
What will we be doing?
- We’ll start with a welcome of pizza and refreshments from our wonderful hosts at Kano.
- Things will kick of properly at 6:30pm with a presentation on the short, medium and long term future plans for Mu. This will be followed by a short question and answer session.
- Next comes 15 minutes for lightning talks. If you’ll be there and have something to share, this is where and when you tell us!
- We end with a practical workshop called, “Debugging With Mu - What is debugging? Why do I need it? How do I do it?”.
At the end, around 8pm-ish, we’ll find a local pub and continue our discussions in a more relaxed atmosphere.
Future Mu-moots look to be even more interesting. Dan Pope, one of the originators of Mu, will be presenting and running a workshop about PyGameZero at the November moot. Tim Golden, one of Mu’s most prolific contributors, will hopefully present and run a workshop about NetworkZero at the December-moot.
If you have an idea for contributing to a future Mu-moot, please get in touch.
The source code is nice and simple, although it relies an two patches which have not yet made it into a release of PyGameZero (so mark this as coming soon). One patch adds joystick support (i.e. what you do with the gamepad) and the other makes it easy to flip sprites.
Coming soon to a PyGameZero/Mu release near you!
Friend of Mu and community supporter extraordinaire Les Pounder writes a blog containing lots of quick, fun and beginner-friendly projects. He calls this sort of thing “tinkology” – a term I really like. Playful tinkering is such a wonderful way to learn and relax. Can you guess what editor he uses? Nope, it’s not EMACS or VI. ;-)
What I love about Les’s blogging is its consistency: there’s always something new and it’s always really imaginative and fun. Les is a great source of ideas for lessons, projects or learning activities for beginner programmers. For instance, on most Tuesdays he writes a “Tooling Tuesday” entry to his blog and many of these have a Python slant to them. Other related series of posts include “Micro:bit Monday” and “Friday Fun”.
Mu related highlights include:
- Friday Fun: Python Pollen Projects
- Tooling Tuesday - Python3 GeoPy
- Tooling Tuesday - Google Image Search With Python
- Tooling Tuesday - easygui
Any of these could form the basis of a cool project, set of lessons or after school code-club activity. So, here’s to Les, his blog and fantastically imaginative projects.
Thank you Les!
What does software development look like? Here’s a short video / visualisation of the creation of Mu as told via the interactions, interventions and changes by developers to Mu’s own source code hosted on GitHub.
What exactly are you looking at?
- The faces represent the developers.
- The multi-coloured blobs are the source code files that make up Mu.
- The lines between the source code blobs show how the files are organised together into directories.
- As time passes, developers can be seen to change, add and delete files as the project matures.
I used the
gourcetool turn the commit history of Mu’s development on GitHub into a video. I added some Creative Commons licensed music and the results look and sound quite effective. What I really like is how the video reflects the wide variety of people and types of contributions made to the source code for Mu. Together, we’re continuing to build the best editor we possibly can for beginner programmers and those who support them.
Ever wanted a pathalogically conflicted artifical intelligence for your own home? Why, of course you do! Adafruit’s CRICKIT board has you covered (along with instructions for how to program it via Mu).
The Crickit (Creative Robotics and Interactive Construction Kit) is a an add-on for the Circuit Playground Express board. Cricket aims to make it easy to make friendly robots and thus make friends with robots (now there’s a sentiment we can all get behind). Essentially, Crickit complements and amplifies the CPX board by making it extraordinarily easy to interact with robotic “bits and bobs”.
What I love about this project is how simple it is to make and program. Once complete, just press the glowing red button to hear audio clips of HAL. The source code is less than 50 lines of Python and, perhaps most importantly, you have a chance to replace the recordings so your HAL is no longer an uncooperative controller of on-board systems, but perhaps a friendly computer in the spirit of Cricket. What’s more, this project is relatively easy to modify to other concepts such as responsive cuddly toys or the world’s most friendly door bell (remember those doors from The Hitchhiker’s Guide to the Galaxy?).
EuroPython (one of the world’s largest, most friendly and culturally diverse Python programming conferences) happened last week in Scotland. Sadly, for personal reasons, I was unable to attend. However, it was great to hear via social media that Mu was used in the opening conference keynote by Pythonista-extraordinaire David Beazley. Not only is it wonderful to see Mu used by someone so well respected in the Python community at such an auspicious occasion, but David’s use of Mu is a wonderful example of Mu’s use as a pedagogical tool. Remember, Mu is not only for learners, but is also for those who support them (i.e. teachers).
What do I mean by pedagogical tool?
The stereotypical example is a blackboard upon which the teacher chalks explanations, examples and exercises for their students. Teaching involves a lot of performative explanation – showing, telling and describing things as you go along; traditionally with the aid of a blackboard. This is a very effective pedagogical technique since students can interrupt and ask questions as the lesson unfolds.
David used Mu as a sort of interactive coding blackboard in his keynote introducing the Thredo project. He even encouraged listeners in the auditorium to interrupt as he live-coded his Python examples.
David and I have never met in real life, although our paths have crossed online via Python (and, incidentally, via our shared love of buzzing down long brass tubes). So I emailed him to find out how he found using Mu. Here are some extracts from his reply (used with permission):
There are some who seem to think that one should start off using a fancy IDE such as PyCharm, VSCode, Jupyter Lab or something along those lines and start piling on a whole bunch of complex tooling. I frankly disagree with a lot of that. A simple editor is exactly what’s useful in teaching because it cuts out a lot of unnecessary distractions.
From a more practical point of view, I choose to use Mu for my talk precisely because it was extremely simple. I do a lot of live-coding in talks and for that, I usually try to keep the environment minimal. […] Part of the appeal of Mu is that I could code and use the REPL without cluttering the screen with any other unnecessary cruft. For example, I could use it without having to switch between terminal windows and I could show code and its output at the same time in a fairly easy way.
This sort of feedback makes me incredibly happy. David obviously “gets it” and I hope his example points the way for others to exploit the potential of Mu as a pedagogical tool. David also gave some helpful suggestions which I hope we’ll address in the next release.
David’s keynote is a fascinating exposition of what you may want from a Pythonic threading library – it also has a wonderful twist at the end which made me smile. I’d like to encourage you to watch the whole presentation either via EuroPython’s live video stream of the event or David’s own screen cast of the keynote, embedded below:
Finally, the exposure of Mu via EuroPython had a fun knock on effect: someone submitted the Mu website to Hacker News (one of the world’s most popular news aggregation websites for programmers). By mid-afternoon Mu was voted the top story and I had lots of fun answering people’s questions and reading their comments relating to Mu.
My favourite comment, which I’ll paraphrase below, will become Mu’s tag-line:
“Python is a language that helps make code readable, Mu is an editor that helps make code writeable.”
We’re pleased to announce the release of Mu 1.0.0, a Python code editor for beginner programmers! There have been only minor changes since the release candidate, full details of which can be found in the changelog. As always, feedback and bug reports are most welcome. We’ve also completed and updated the tutorials on the website.
Many people have been involved in getting Mu to 1.0, and, if you use Mu, it would be a wonderful gesture if you could thank them via social media. Details of who to thank can be found here.
Some interesting facts and figures about Mu:
- 34 people have contributed code.
- There are currently only 3907 lines of Python code in Mu.
- We have 100% unit test coverage.
- Our code quality rating on LGTM is A+.
- There have been 1115 commits since the project was started on 7th December 2015.
- We’ve closed 341 issues.
- We have extensive developer documentation.
- Our online chat is growing.
Finally, earlier this week, we had our first ever Mu-moot in the MUseum Tavern in London. Not everyone could make it, but the photo below is of most of the core contributors:
(Al Broomhead [front-left], Martin O’Hanlon, Zander Brown, Dan Pope, Steve Stagg, Carlos Pereira Atencio, Tim Golden and Nicholas Tollervey [front-right].)
Everyone went away with an exclusive Mu t-shirt, the custom designs for which I’ll post on social media.
But before doing anything else, I’m going on holiday for a week. :-)
The release candidate for Mu 1.0.0 is out! This is the last step before the final release of Mu 1.0. Apart from a few minor bug fixes, the biggest change from beta 17 is the inclusion of various translations for the user interface. Full details can be found in the changelog.
Many thanks to the following people for their magnificent work on the following translations:
- Chinese (incomplete), by Pydo.
- Japanese, by Minoru Inachi.
- French, by Gerald Quintana.
- Spanish, by Carlos Pereira Atencio.
- Portuguese, by Tiago Montes.
I would love to include more translations in the final release, especially if they’re in one of the following languages:
(This list reflects both reach and accessibility of languages so Mu is usable by as many beginner programmers as possible.)
Other highlights include a fix to allow users of Adafruit devices to save a file called
code.py. This was getting erroneously caught by the new “shadow module” feature which, in this specific case, doesn’t apply. Zander Brown continues to make extraordinary progress in making the user interface both great to look at and consistent across all platforms. We had quite a bit of feedback from teachers who value such UI consistency: it allows them to create resources that apply to all platforms, thus avoiding all the complications of, “if you’re on
<platform>, then this will look different” interruptions in the flow of such resources. Finally, Tim Golden and Jonny Austin have done sterling work testing the various fixes for problematic edge-cases in the new BBC micro:bit flash functionality.
I had a stonking time yesterday afternoon with Harvey Sharman, who runs workshops for young coders in a library close to where I live. This particular afternoon was spent in the company of a group of eager eleven-year-olds. Harvey’s learning activity? Use Mu to program “transmitter” and “detector” micro:bits so the kids could organise a treasure hunt in the library. Let joyful coding chaos ensue!
I first became aware of Harvey’s work via the following tweet:
One of my pupils inspired in Python Mu hard coding the International Space Station project to collect live data of latitude and longitude coordinates to locate the actual position of the space station using an A3 print of the global map with coordinates. @ntoll 🛰️ @rebeccafdp pic.twitter.com/Ke2JKzDiju— Harvey Sharman (@BitawsBrackley) June 28, 2018
It was a stroke of luck that I live in the next village from Harvey and I just had to investigate. As a result I was invited to observe Harvey and his students in action.
The group of eleven-year-olds sped through the task of writing the code, checking it and flashing it onto the micro:bit. Then the group split in two: half were unleashed into the wider library to hide their “transmitter” micro:bits and upon their return the other half were let loose, waving around poles with their “detector” micro:bits stuck on the end. If the “detector” got close to a “transmitter” it would start to bleep and the “X” on the micro:bit’s display changed to a number to indicate the relative proximity of the devices.
Imagine, if you will, a sleepy afternoon at Brackley library: the knitting circle quietly click-clacking in one corner, a pensioner’s jigsaw club (armed with tea and biscuits) in yet another, and a hoard of enthusiastic eleven-year-olds waving around blinking and bleeping poles at anything and everything (including the afore mentioned knitting circle and jigsaw club) in an attempt to find “treasure”.
To say the kids had a huge amount of fun is an understatement (to their credit, the other library users were very patient and I was especially pleased to see maniacal grins on the faces of the librarians as the kids explored all the various sections of the library). Public libraries are such an asset to our communities since they’re the only place the pensioner’s jigsaw club could rub shoulders with eleven-year-olds from a code club. Two different parts of the same community got to see what each other were doing.
Afterwards, when the kids had left, we recorded the following video to explain how things work:
The source code is very simple and takes only minutes to type in. The detector works by checking the strength of radio signals. The stronger the signal of a received message the closer you are (and the higher the number displayed and the bleeps from the speaker). The transmitter micro:bits constantly send out signals at the lowest possible power so the signal is only detected when you’re stood close by (I’d say around 3 to 4 meters). This is beautifully simple and ingenious and could form the basis for all sorts of interesting classroom activities and learning opportunities. How might you improve the code?
Harvey tells me that Mu makes Python programming easy for his young coders and my own observations during the workshop confirm this. It took moments for the kids to figure out what to do. It was also cool to see them help each other and make suggestions for using Mu. For instance, once one kid figured out how to use the autocomplete functionality to avoid typing long words, they were all at it after the inevitable, “hey, look at this!”.
I look forward to more projects, games and “hacks” from Harvey and his young charges (and I’ll keep you posted!).
We’re pleased to announce the availability of Mu 1.0.0-beta.17, a Python code editor for beginner programmers! This is the final beta version before a release candidate later this week and the final 1.0 release sometime next week. This version is feature complete for 1.0. Any further changes will be bug fixes or cosmetic changes rather than new features.
The full list of changes can be read in the developer documentation. However, highlights include:
- A major re-write of how MicroPython code is flashed onto the BBC micro:bit. If there’s one thing we’d love to be tested by users, it’s this! All feedback most welcome (submit a new issue if you find a problem or discuss things via online chat).
- The latest and greatest version of MicroPython for the BBC micro:bit.
- Updates to the Python visual debugger (which is working really well).
- Protection from “shadow modules”. When many new programmers first save, for
turtlebased code they call their file
turtle.py. This breaks Python in a subtle yet opaque manner for beginners. Of course, their new
turtle.pyfile takes precedence in the import path, so where their code says
import turtleit is, in fact, trying to import itself..! Not a good situation for anyone, let alone a beginner programmer. As a result, Mu will complain if you try to give a file the same name as an existing module on your Python path. We know from extensive feedback this feature will save hours of confused head-scratching for beginners and teachers.
- We’ve also added a very simple yet remarkably useful “find and replace”
dialog which you can access with the
Ctrl-Fhot key combination.
- Talking of hot key combinations, if you highlight some text and press
Ctrl-Kit’ll be toggled between commented and uncommented. If no text is highlighted, the current line is toggled between these two states.
- Mu has been updated to use the latest version of Qt as its GUI framework.
- Plenty of minor fixes, tidy-ups and bugs squashed.
The next release will be a bug-fix “release candidate”. This will be a dress rehearsal for the final release which will follow soon after. Happily, most of Mu’s test, build and package infrastructure is automated. However, since this is still a process with several different components that need to be synchronised and checked (such as blog posts announcing the release and documentation updates) and some manual interventions (such as digitally signing the installers for OSX and Windows) we want to make sure we get this process right first time!
As always, feedback, bug reports and ideas would be most welcome!
Caitlinsdad has created colourful Rainbow Pride Traffic Lights with Mu and CircuitPython. This is great timing since Pride month just finished and today tens of thousands of people are taking part in the Pride in London Parade. Thanks to Adafruit for the heads-up!
So I have an Adafruit Circuit Playground Express board to play with. This project seems like a good way to learn Circuit Python programming and to get more familiar with the Mu Editor and REPL function.
Thanks to some epic cardboard crafting, Neopixels, a healthy dollop of paint and experimentation with timings in the CircuitPython code, the results are a customizable rainbow light-show:
By day Keith is a healthcare informatics professional. By night, like many of us, he builds robots and other Maker-type projects. This particular project blinks different messages in Morse code. You can configure the LED colour as well as toggle the buzzer (so the board “bloops” Morse code too).
He says, “I love the idea that I could use Python to program a microcontroller” and explains the origin of the project as follows:
I was at the San Mateo Maker Faire this year (I was at the first one, and have been there or NYC Maker Faire every year since). I had brought the CPE with me to play with in case I had any free time (I hadn’t had time to really mess with it - big project at work). My flight Sunday night was cancelled, so I thought I might go to the Bring-a-Hack event. I didn’t want to show up empty handed, but all I could think up was a lame demo of the CPE. I quickly re-reviewed some tutorials, and wrote a quick program in my hotel room. Didn’t work at all. Tried different things, cut-and-paste sample code (which all worked), finally gave up. At that point I was tired, and had to get up early for a flight, so I canned it. When I got back to St. Louis and read through the code again, I realized I had thought that time.sleep was in milliseconds (like Arduino Delay), rather than in seconds. The original code I had written was actually fine - just a thousand times slower than I was expecting. Once I fixed that, it was fine. I’ve since cleaned it up a little.
Thus proving the old adage that, “good things come to those who wait”. ;-)
Keith has helpfully provided a video of his code in action:
The project’s source code contains a complete implementation of a Morse code transmitter that could form the basis for many future beginner-friendly projects. If you’re interested in changing the transmitted messages you should modify lines 92 and 95. The Morse code definition is in a Python dictionary on line 22 and the loop, starting on line 98, is a great example of how to convert characters into Morse code. Check it out!
I wonder, how hard might it be to implement simple signal processing using the Circuit Playground Express’s microphone or light sensor to detect the message transmitted from a second device and emit the result to the CircuitPython REPL? (That’s a trick question… it’s very easy, but I leave it as an exercise for the reader to solve.)
As for Mu, Keith says it is, “certainly convenient for programming the CPE (and BBC micro:bit). The biggest thing I miss is a keyboard shortcut to comment/uncomment bits of code. That would make troubleshooting so much faster.” Check out progress for this feature request on our issue tracker.
Thank you Keith for such an easy-to-follow Morse code project!
Everyone else, if you extend or re-use this code, let us know! We love to shine a light on the hard work of Mu users (no pun intended). :-)
Leila and Emma got in touch to tell us they’ve made themselves a stylish homemade clock! Using an Adafruit M0 Trinket, a quad 7-segment display and various other components they hacked all the CircuitPython code together in Mu! Read on to learn more…
I first met Leila and Emma in 2015, when Trans*Code was first welcomed to PyCon UK. On subsequent meetings it has always been a great pleasure to hear of their homemade electronics projects and how they’ve thought up ever more creative and interesting ways to use MicroPython or CircuitPython in their work. They have been great supporters of Mu since the very earliest releases, so “thank you” both for your encouragement, feedback and support.
When the call went out for user-contributed projects for this blog, it didn’t take long for them to submit the first contribution, and what a fun project it is!
Their own digital alarm clock broke, and none of the replacements fitted their requirements, so rather than buy a new one they used it as an opportunity to learn and make their own.
What I love about this project is that it took several attempts to get it right. In the end they came up with a device that worked with a much simpler design than their original solution (that didn’t work at all!). This is a common occurrence: it takes time to work out how to solve a problem and you’re likely to encounter unforeseen problems along the way. Only after “playing around” and experimenting for a bit will a simple, elegant and (most importantly) working solution emerge.
Another aspect of the project that I really like is its Wabi-Sabi-ness. I’m a big fan of Wabi Sabi (while the linked-to Wikipedia article is interesting, I recommend this wonderful little book for those who want to learn more). Wabi-Sabi is the beauty found in impermanent, incomplete and unconventional objects. The development of, and solution for this project is a wonderful example of such beauty.
Finally, the code they created in Mu has a really cool feature to handle button presses to change modes (their clock not only tells the time, but will display the date and year!). This is another important aspect of the project: Leila and Emma are in control of their digital device and, if they feel so inclined, are free to change how it works or fix any bugs. They can hack it!
You can read Leila’s full write-up of the project, including source code and circuit designs at her blog.
Great work Leila and Emma! :-)
Adafruit, the brainchild of Limor ‘Ladyada’ Fried, was founded to create the best possible resources, boards and designs for learning about electronics and programming. Over the last decade she and her colleagues have surpassed their initial goal and become the touchstone for inspiring a community to engage with making electronic devices for serious, playful and educational use. Perhaps most importantly, Limor and her colleagues have become worthy role models to many for whom electronics or programming may, at first, appear “not for them”. They have been celebrated by the WhiteHouse, written about in high profile magazine articles (such as for WIRED and MAKE magazines) and been the recipients of several awards.
They are fearless in their support for and promotion of under-represented groups in technology. As they say on their website,
… we’ll do our best to shine a light on the untold stories of women in STEM and underrepresented champions from all over the world.
Happily, Adafruit support their own flavour of MicroPython (think of it like an Adafruit “distro” of MicroPython) called CircuitPython. CircuitPython provides a uniform and consistent API for all the many and growing number of Adafruit boards that it supports. This makes it very easy to transfer your skills and knowledge between different types of device, be it a minute Gemma board or the spectacularly colourful and feature-ful Circuit Playground Express.
Mu has a CircuitPython mode which understands how the boards work (for example, you store your source code on the connected device’s USB storage). It also provides a couple of short-cut functions to help you interact with your CircuitPython device. For example, reading from and interacting with the connected device’s serial connection is but a button press away:
Perhaps my favourite feature is the plotter, which allows you to visualise data coming from the connected device. The plotter was originally contributed by Limor herself. The following video shows Limor explaining how to visualise the data coming from the light sensor of a Circuit Playground Express with the plotter built into Mu (originally blogged here):
What’s really great about this example is how short the Python code is:
There are plenty of projects and videos for using CircuitPython and Mu on Adafruit’s website.
Check it out..! If you create something awesome, please tell us about it! :-)
Have you ever wanted to write a game? It turns out that Mu and PyGame Zero make this really easy for beginner programmers. Read on to learn how the author used both to create a goofy game for the wonderful PyWeek event.
PyWeek is a fun, community-organised game-making event / competition that doesn’t take itself too seriously. As the website says, the PyWeek challenge:
- Invites entrants to write a game in one week from scratch either as an individual or in a team,
- Is intended to be challenging and fun,
- Will hopefully increase the public body of game tools, code and expertise,
- Will let a lot of people actually finish a game, and
- May inspire new projects (with ready made teams!)
As the name suggests, all entries should be written in Python and incorporate a theme announced at the start of the challenge.
PyWeek happens a couple of times a year and in April it was organised by my buddy Dan Pope (aka lordmauve). Dan has many claims to Pythonic-fame, but the one I’m going to focus on today is that he’s the creator and maintainer of a wonderful library called PyGame Zero. As the name suggests, PyGame Zero is based upon another wonderful library called PyGame (maintained by another equally talented buddy, René Dudfield). PyGame makes it very easy to create graphical games in Python. PyGame is highly portable which means that games made with PyGame will run on plenty of platforms. PyGame Zero is a beginner-friendly wrapper around PyGame.
Dan created PyGame Zero after working with a group of teachers at PyCon UK’s education track. Since he’s a gifted and experienced game developer he was able to create a simple graphical game in about an hour. As he did so, he explained to the watching teachers exactly what it was he was doing. However, the feedback from the teachers was clear (paraphrased), “While PyGame might be easy for you (Dan), the kids we teach would find it hard to put together 10 lines of Python, let alone the 500 line you just created; we need a way that makes it easy to create something cool with very little code”.
And so, the seeds for PyGame Zero were sown. Dan has created a simple and easy-to-understand wrapper that enables learners to make something graphical in only a handful of lines of code. If you’re interested in learning more about PyGame Zero (including a really great tutorial) go check out the beautifully written project documentation.
Since Mu has a PyGame Zero mode, I thought I’d enter the most recent PyWeek and try to create my first ever game using just Mu and PyGame Zero. The theme was “two worlds” and after an ideas generation session (with input from my three kids) the concept for a game, called Paperchase, was born.
The blurb for the game says…
The intergalactic war between the red and blue factions of the biro universe has reached its climax. Each world has sent a stick-figure champion to race in the “Paper chase” for ultimate victory and to decide which colour biro pen teachers should use when marking work. (Get 200 steps ahead to win, collect up to 3 Python power-ups to import antigravity and avoid all other obstacles.)
The PyGame Zero tutorial shows you how to make an animated alien float across the screen. I took this as my starting point and, after several hours of drawing and discarding a huge number of naff-looking stick figures and and taking about 5 minutes on only a few lines of Python code I had this:
(Interesting aside: I estimate I spent about 80% of my time in PyWeek drawing, testing and revising game assets like the animations and objects in the game. Of the remaining 20% of my time, most of it was spent reading PyGame Zero’s excellent documentation to guide me in how to make something or other work. Time spent actually writing Python code was probably only 5% of the total.)
During PyWeek, participants are encouraged to submit diary entries to plot their progress and so others can see how they’re getting on. This was a wonderful experience because participants leave supportive comments on each other’s diary entries and even give user-created “awards” (for instance, I gave one game “Ent of the Year” since the game involved becoming the spirit of a tree). You can read my diary entries here and all the participant’s diary entries are here.
At the end of the week of coding, participants judge each others’ entries and a winner is declared for both individual and team entries. I’m pleased to say I placed a respectable 8th out of 23.
Most importantly for Mu, I was able to try out writing an actual real-life game with it. The experience was remarkably smooth and it was fun to type some code and click the “play” button to immediately see the change take effect. Such a quick turnaround in a write-play-check-change cycle makes coding games lots of fun. I also quickly appreciated the ability to just copy and paste the different sorts of game asset into the right locations thanks to Mu’s shortcuts to the file system.
I’d highly recommend everyone take part in a PyWeek – it’s a fun and supportive community who are friendly to newbies (such as myself). If you do take part, please consider using Mu and PyGame Zero!
How did the game turn out? Here’s a video of me and my thirteen year-old son play-testing the game. The source code can be found here.
Welcome to “Made With Mu”, a blog to celebrate the projects and achievements of users of the Mu Python code editor. Mu is a Python editor for beginner programmers based on extensive feedback given by teachers and learners. The project’s main website can be found at codewith.mu.
If you have a project you’d like celebrated here, use the form on the submit page (also linked from the site’s header) to tell us about it..!
We welcome submissions from anybody, no matter your skill level, project type or background. If you’re thinking, “they probably don’t mean me” then we definitely mean you.
We’re friendly and, if needed, will help make sure your project is presented in the best possible way.
What are you waiting for? Go submit something!
Subscribe via RSS