How Does a Computer Run a Python Program?

In order to understand what happens when you’re programming, you need to have a basic understanding of how a computer executes a program. The computer is assembled from pieces of hardware, including a processor that can execute instructions and do arithmetic, a place to store data such as a hard drive, and various other pieces, such as a computer monitor, a keyboard, a card for connecting to a network, and so on.

To deal with all these pieces, every computer runs some kind of operating system, such as Microsoft Windows, Linux, or Mac OS X. An operating system, or OS, is a program; what makes it special is that it’s the only program on the computer that’s allowed direct access to the hardware. When ...

Get Practical Programming, 2nd 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.