RaspberryPi Python Programming - An Intensive Introduction
Duration: 5 Days
Course Background
The goals of this course are to get introduce attendees to the world of programming using Python as
their first, serious, programming language. There have been many discussions over the years regarding the
use of Python as the first programming language to teach. Unlike C Python is a high level interpreted language.
It is also an extremely effective wrapper and glue language and provide access to many complicated applications
written in e.g. C or C++. It can also be used as a scripting language for administering systems whether they
be Linux or Microsoft Windows running on a PC, or Linux running on an embedded platform (e.g. the RaspberryPi).
Another interesting aspect of Python is that it can support a variety of programming language styles.
This course will cover Python programming not only on Linux systems (PC running Linux, or RaspberryPi running Linux) - but will
also, demonstrate the portability of Python by running Python programs on Windows platforms.
In the eclectic spirit of FTT's RaspberryPi courses Python scripts communicating with embedded devices such as
Arduino or Microchip PIC16/PIC18 devices. will be demonstrated and discussed
Because of the widespread use of RaspberryPi's in teaching environments Bootcamp variants of this course oriented towards teachers will include workshops exploring the use of Python programming and the RaspberryPi in the context of the CAS - the Computing at School initiative. These sessions will enable teachers to discuss the development of teaching materials and the use of Pythonic computer graphics and computer games programming in the classroom.
Course Benefits
You'll learn how to write Python programs to process text and data, read and write files and communicate over e.g. RS232 and USB with Arduino or PIC16/18 based embedded systems. You will also be shown how to write Python scripts that perform various system administration and configuration tasks on Linux (PC based and RaspberryPi based), and, in the spirit of portability, you will also be shown how to develop and run Python applications on Microsoft Windows machines. Hopefully, if you are planning to teach Python at the school level this course will give you some ideas and starting points as to how you might go about setting up a Python curriculum in your school. Some of the ideas in this module have grown out of experiences learned running an Arduino workshop at Europython 2010.
Course Prerequisites and Target Audience
Attendees should have a basic understanding of Linux, e.g. as might be acquired by attending the Introduction to the RaspberryPi course and who have chosen Python as their first major programming language to study. You are expected to have a basic knowledge of how to use Linux, both from the desktop and from the command line. You are not expected to be programmers, though a little prior exposure to e.g. Javascript or VBA would not go amiss. As always, a positive attitude to open source software would be most helpful, as would an enthusiasm for exploring and playing around with new technologies.
Course Outline
- First steps
- How Python became - or a tale of what a restless programmer go up to one Christmas.
- The upwards and upwards growth of Python and the many fascinating uses Python is being put to these days
- Installing Python 2.7 on your PC and on the RaspberryPi.
- Installing Python 3.3 and its coexistence with Python 2.7
- Introduction to Python Virtual Environments
- Python - Basic grammar and syntax
- Basic I/O - print() and raw_input()
- Comments
- Variables and Assignment
- Operators
- Basic data types - numbers, strings, lists, tuples and dictionaries
- Code blocks and indentation
- if, elif and else
- Iteration
- for, in and range loops
- while loops
- File manipulation - open() and file()functions
- Errors and Exceptions
- Functions
- Packages
- Introduction to Object Oriented Thinking and Object Oriented Programming
- What does Object Oriented mean ?
- Advantages and benefits of object oriented approaches to designing applications
- Python Classes
- Python Modules
- Python Objects
- Objects
- Computer Game Programming for Fun, Teaching and Profit
- Structure of simple computer games
- Programming problems that need to be solved when implementing a computer game
- Overview of PyGame
- Building and extending PyGame programming examples
- Overview of some other Python game programming frameworks - e.g. Pyglet, Panda3D, GameBlender
- Objects
- Overview of more advanced Python topics and applications
- Note: This will be a fast paced conference style presentation. Specialised courses can be created on demand, and discussed in a Python follow on discussion forum.
- Regular Expressions
- Network Programming
- Internet Client Programming
- Multithreaded Programming
- GUI Programming
- Web Programming
- Scientific and Mathematical computing
- Python and Geographic Information Systems
- Python and Data Analysis and Statistics
- Python applications to talk to small embedded systems targets
- Talking to Arduino over RS232
- Talking to PIC16/PIC18 embedded systems over RS232
- Overview of communicating via ethernet and USB - demonstrations and examples