First steps with Python programming

Lead Image © Eric Isselee, 123RF.com

Snakes Alive!

Take your first steps with Python programming and discover the turtle module for creating graphics.

Don't be afraid of the snake: Python might look intimidating if you haven't done much programming before, but it's friendly. If you're using a text-based programming language for the first time, Python is a great choice. Raspberry Pi Foundation co-founder Eben Upton has called Python his favorite language for learning and development, and it's a natural next step after Scratch.

If you're an experienced programmer, you'll find that Python is powerful and helps you be productive. It's not just an educational language: Google hires Python programmers, and the language was used by Industrial Light and Magic in producing Star Wars: Attack of the Clones. With all those spaceships and light sabre fights, few people noticed the Python in the background.

Two different versions of Python are in popular use today, and the Raspberry Pi supports both of them. Python 3 is the latest version of Python, and it's the one that's being actively updated. The only reason not to use it is that some software you might want to use doesn't yet support Python 3. In those circumstances, retreat to Python 2.7. Most of the time you won't have to worry about which version you're using, but programs for Python 2.7 won't always work in Python 3 and vice versa.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF

Pages: 5

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Pi with Sugar and turtles as a learning tool

    Despite its popularity elsewhere, the Raspberry Pi is first and foremost an educational tool designed with primary and secondary students in mind. We look at how teachers can make the Pi fulfill this role with the help of the Sugar Educational Desktop and turtle graphics.

  • Python Primer

    Your Raspberry Pi comes with Python, a flexible open source programming and scripting language. Download this PDF for a quick tutorial on getting started with Python.

  • Using Scratch to explore turtle geometry

    We show you how to use some simple Scratch concepts to create shapes and patterns.

  • How to get your Pi to go

    Pi2Go-Lite is a new fully integrated robot kit that makes it easy to get into robotics with the Raspberry Pi. We speak to its creator about how it works, then build our own autonomous line-following robot.

  • Math, Music, and Cat Toys

    Welcome to Raspberry Pi Geek – the first and only print magazine dedicated to the amazing Raspberry Pi mini-PC and the open hardware revolution. We ring in the new and old in this issue. (Actually, nothing is really very old with the Raspberry Pi, but we follow up on some previous themes, including a report on how it went for the wind-turbine-powered Raspberry Pi we described last time.)