Menu

Tag: python

hostedpi

Cambridge-based hosting company Mythic Beasts — long-time friends of Raspberry Pi people and products — launched a unique service back in 2016: Raspberry Pi hosting, what they call their “Pi Cloud“. When I developed the first version of piwheels, it made sense to make use of this service to...

PyCon UK 2023 talks

I was back in Cardiff for PyCon UK recently and gave a talk on a BBC project I’ve been working on, called Live Highlights. I’m not doing as many conference talks as I used to – this is my only one of the year! I spoke about how we prototyped an idea and built it up to be used in audience-facing...

BBC open sourcing mosromgr

For the last few months in BBC News Labs, I’ve been working on various projects involving extracting metadata from running orders for BBC programmes such as Newsnight and the R4 Today programme. Like many traditional broadcasters, the BBC uses the MOS Protocol for communications between newsroom...

Accessing Python package index JSON APIs with requests

PyPI, the Python package index, provides a JSON API for information about its packages. This is essentially a machine-readable source of the same kind of data you can access while browsing the website. For example, as a human, I can head to the numpy project page in my browser, click around and see...

The IPython shell and Jupyter notebooks

The Jupyter project started out as IPython and the IPython Notebook. It was originally a Python-specific interactive shell and notebook environment which later branched out to become language-agnostic, supporting Julia, Python and R – and potentially anything else. IPython is a Python shell –...

virtualenvwrapper

For some time, Python has had support for managing virtual environments. Python 3.3 even added the built-in module venv for creating environments without third-party libraries. There are a number of different tools Python programmers use to manage their environments and the one I use is called...

Meme Overflow

A few months ago I was looking through questions posted to the Raspberry Pi Stack Exchange site. If you’re not familiar, Stack Exchange provides Q&A sites like Stack Overflow for specific areas, such as particular programming languages, technologies or other topics. And while observing the erratic...

deadsnakes

The deadsnakes PPA lets you install multiple Python versions on your Ubuntu system, so instead of only having just the Python 2.x and Python 3.x that comes with your distribution (18.04 comes with Python 3.6, and 2.7 is available), you can install older or newer versions, from 2.3 (!) to 3.8! The...

Tags: python ubuntu

logzero

I’m not sure whether logzero took its name to fit in with the series of “zero boilerplate” libraries like pygame-zero, GPIO Zero and guizero, but it’s certainly in that category. It’s a Python library that makes logging straightforward. It makes logging as easy as a print statement, which is a big...

Tags: logging python

What’s new in GPIO Zero v1.5?

It’s become customary for me to summarise what each new GPIO Zero release brings. This one’s been a long time coming. It’s been a quite while since our last release (a whole year since the last point release and 18 months since v1.4). I mostly attribute the lack of development to the launch of my...

EuroPython, PyCon UK and a John Pinner Award

I’ve been lucky enough to have been able to attend (and speak at) two great Python conferences – EuroPython and PyCon UK – (almost) every year since 2014. I’ve been to EuroPython in Berlin, Bilbao and Rimini, and this year it came to the UK – specifically, the beautiful city of Edinburgh. I...

Raspberry Pi Zero GPIO expander

The recent announcement of the latest release of the Raspberry Pi Desktop x86 image alongside Raspbian Stretch for Raspberry Pi included mention of a GPIO expander tool, which was followed up by another blog post explaining how it works and how to use it. Since it uses pigpio to control the GPIO...

Raspberry Pi talk at EuroPython

I have attended and spoken at the EuroPython conference for the last few years, and this time I focused on physical computing with Python and Raspberry Pi, including GPIO Zero, Picamera and the Sense HAT. The slides are on speakerdeck and you can watch the video here:

piwheels: building a faster Python package repository for Raspberry Pi users

The title may have given away the article contents, but feel free to read on pretending you don’t know the ending. Background: I work for the Raspberry Pi Foundation and I do a lot of Python stuff on Raspberry Pi. I presented this project recently in a lightning talk at EuroPython. Motivation:...

What’s new in GPIO Zero v1.4?

It’s been a while since the last GPIO Zero release, so it’s with great pleasure I announce v1.4 is here. Upgrade now on your Raspberry Pi: sudo apt update sudo apt install python-gpiozero python3-gpiozero Or on your PC: pip install gpiozero Why on your PC? Run Python code on your PC to remotely...

Python and Raspberry Pi talk at FOSDEM

Earlier this month, I spoke on the Python track at FOSDEM 2017. My talk introduced the Raspberry Pi as a tool for physical computing and IoT to Python programmers in the free & open-source software community. I talked about the Raspberry Pi Foundation’s mission, our education programmes, introduced...

Christmas Coding Challenge – Uno

During this Christmas break I decided to have a go at implementing the card game Uno in Python. It’s a fun and simple game for all ages, and the rules are easy to pick up and follow – but there’s quite a challenge in implementing the rules in a program! I spent a few hours over a few evenings...

Tags: code python tdd uno

PyCon Russia keynote – Physical computing with Python and Raspberry Pi

I was invited to give the closing keynote at PyCon Russia, which took place in Moscow in July. It was my first visit to Russia – and I had a great trip. Today I am mostly being the Raspberry Pi Community at @PyConRu pic.twitter.com/U88J1rcMNZ — Ben Nuttall (@ben_nuttall) July 3, 2016 I travelled...

What’s new in GPIO Zero v1.3?

One year ago today, I started the GPIO Zero project. We now have a core team of three (Dave Jones, Andrew Scheller and me). There have been 587 commits, we’ve released four major versions, and published a book. The library has great coverage of GPIO devices, and contains features I never even...

Simple Electronics with GPIO Zero book

Today the MagPi team released a new publication: Simple Electronics with GPIO Zero. This 100-page book takes you from the basics, like lighting an LED, all the way to building projects like an Internet radio using the GPIO Zero Python library. This book is available as a free PDF, but you can also...

What’s new in GPIO Zero v1.2?

GPIO Zero is a Python library I created to make physical computing on the Raspberry Pi more accessible, particularly for use in education. Read more about it on raspberrypi.org, or about how it was created in an article on this blog, GPIO Zero: Developing a new friendly API for Physical...

GPIO Zero: Developing a new friendly Python API for Physical Computing

For about the last 3 years, the de-facto method of accessing physical components via the Raspberry Pi’s GPIO pins has been a Python library called RPi.GPIO, created by Ben Croston, who originally built it to control his beer brewing process. Despite its humble beginnings in a personal hobby...

The story of pyjokes

Last year I was invited to speak at PySS in San Sebastian, Spain, and I met a great bunch of guys: the conference organisers Alex, Oier and Borja. We started a project called pyjokes (one line programmer jokes; jokes-as-a-service) I gave a 5 minute lightning talk at PyConUK last weekend telling how...

Tags: pyjokes python

Review of the Year 2014

Last December I started my job at the Raspberry Pi Foundation and this time last year, having just completed my first month, I wrote my review of 2013 and all the events which led up to that move. Here is a round-up of all that’s happened since then. Talks & Conferences This year I gave my first...

All the Python Conferences

In the last two months I’ve attended and spoken at five Python conferences around Europe. EuroPython – Berlin I submitted a proposal to EuroPython in Berlin for a talk explaining what the Raspberry Pi Foundation are doing in education. Luckily it was accepted and I got to go to...

STEM Raspberry Jam Pilot

I organised an event with the STEMNET (Science, Technology, Engineering & Maths Network) team at the Museum of Science and Industry (MOSI), based on the Manchester Raspberry Jam I run monthly at Madlab. The STEM Raspberry Jam was to be a new activity the STEM Ambassador network could offer to...

Comprehension in Python

Python is a wonderful dynamic language offering various functional programming features, including standard library modules itertools and functools borrowed from Haskell and Standard ML. Some see it as the best of both worlds as not only can you perform complex tasks with these functional...

Hack Manchester

Last month I attended Hack Manchester – a 24 coding event as part of the Manchester Science Festival, held at MOSI. Having only arranged to team up with Mike, we ended up joining two guys Shaf introduced us to, his colleagues from the BBC, by the names of Jack and Tom. The four of us formed a team,...

Manchester Raspberry Jam Continued

I’ve now hosted four Raspberry Jams in Manchester. I posted about the first and second, here’s a summary of what went on at III & IV. The August Manchester Raspberry Jam kicked off when Kat opened up the Madlab and I gave an opening talk about what had been going on in the news in the Raspberry Pi...

Manchester Raspberry Jam

I’ve now run two Raspberry Pi events in Manchester, affectionately known as the Raspberry Jam. The first in June, which was the first Raspberry Jam in the UK, and which featured on the Raspberry Pi Foundation’s website where we gained recognition for getting people together to share ideas,...

ASCII Bar Charts for Quick & Easy Visualisation

So you have some data. Let’s say it’s a record of the number of instances of some things. Let’s say it’s the number of movies you own, grouped by the year they were released. Let’s say you have those data in the form of a dictionary in Python, like so: years = {2000: 2, 2001: 9, 2002: 10, 2003: 9,...

PHP 5.4 Released

So the other day, Rasmus tweeted that PHP 5.4 was fully released (following several release candidates): PHP 5.4.0 is out – go get it #php — Rasmus Lerdorf (@rasmus) March 1, 2012   There are some great additions, the highlights (other than a huge increase in speed, apparently) being square...

Tags: php python

Ternary Operator and Other Shorthand Code

The ternary operator is a shorthand way of writing an if/else statement where a particular action occurs in both cases, but the value associated with that action depends on the condition stated. For example, the traditional if/else construct (C/Java/JavScript syntax): if (a > b) { result =...