From the course: Building the Classic Snake Game with Python
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
A starter template for turtle graphics programs - Python Tutorial
From the course: Building the Classic Snake Game with Python
A starter template for turtle graphics programs
- [Instructor] So let's make a start. Python turtle graphics caters for different levels of ability and experience, and because of this, there are sometimes different ways of achieving the same result. There are two styles of coding, which you can use with Python turtle graphics, which is sometimes referred to as interfaces. These are called the procedural interface and the object-oriented interface. What I'm going to do now is show you an example of the procedural interface. So I'm going to create a new file. Python file. And I'm going to call this procedural.py. And this is the kind of code you'll be creating if you're a beginner with Python turtle graphics and you're not interested in going particularly far with it, you're just using it to kind of mess around. So you would do from turtle import all. And then simply set a color by doing color. And then we can have forward, which can be abbreviated to fd. So forward 100 pixels, right 90 degrees, and then forward 100 pixels again. I'm…