CHAPTER 2

image

Exploring Python

In the previous chapter we entered our Python code a line at a time, but now we are going to put the interactive interpreter to the side and start creating Python files. In this chapter we will cover more of the building blocks of Python code, and show you how to use classes to help with creating games. We will also explain how to use the code libraries that come with all installations of Python.

Creating Scripts

A file containing Python code is called a script. All you need to create scripts is a simple text editor, but it’s best to use an editor, often referred to as an “IDE”. IDLE (which comes with the standard distribution ...

Get Beginning Python Games Development : With Pygame, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.