O'Reilly logo

BeagleBone Essentials by Rodolfo Giometti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing an LED in Python

Now let's try to manage our LED using a Python script. There are several possibilities to get a running web server with Python, but the easiest one is definitely the BaseHTTPServer library.

You can refer to a simple usage of the library in the chapter_04/webled/python/httpd_show_info.py demo script in the book's example code repository, where we will show you how the server handler processes the incoming requests by showing all the fields available at the disposal of the programmer.

The first part displays the definition of the server listening address, while the second part defines the GET requests handler, that is, the function to be called each time the browser performs an HTTP GET request.

The third and fourth parts ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required