11. Invent Your Own Computer Games with Python by Al Sweigart
Invent Your Own Computer Games with Python teaches you how to program by making video games. Each chapter gives you the complete source code for a new game and teaches the programming concepts from these examples. Invent with Python was written to be understandable by kids as young as 10 to 12 years old, although it is suitable for any age.
This second edition has revised and expanded content, including using the Pygame library to make games with graphics, animation, and sound.
The book focuses on three different areas:
- Series of tutorials ranging from a simple “guess the number” game, to drawing game boards with ASCII art, reversi, and simple artificial intelligence simulation.
- Make the design for a Hangman game.
- Learn new methods and functions that come with Python.
- Simple mathematical concepts including Cartesian coordinate systems, X-axis and Y-axis, the commutative property of addition, and absolute values and the abs () function.
- Use the Pygame library to make games with graphics, animation, mouse input, and sound.
- Make graphical user interface programs that have graphics and can accept input from the keyboard and mouse.
The programs in the book use Python 3.
The book is available under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 license.
12. Test-Driven Development with Python: Obey the Testing Goat: Using Django, Selenium, and JavaScript by Harry Percival
By taking you through the development of a real web application from beginning to end, the second edition of this hands-on guide demonstrates the practical advantages of test-driven development (TDD) with Python. You’ll learn how to write and run tests before building each part of your app, and then develop the minimum amount of code required to pass those tests. The result? Clean code that works.
In the process, you’ll learn the basics of Django, Selenium, Git, jQuery, and Mock, along with current web development techniques. If you’re ready to take your Python skills to the next level, this book—updated for Python 3.6—clearly demonstrates how TDD encourages simple designs and inspires confidence.
- Dive into the TDD workflow, including the unit test/code cycle and refactoring.
- Use unit tests for classes and functions, and functional tests for user interactions within the browser.
- Learn when and how to use mock objects, and the pros and cons of isolated vs. integrated tests.
- Test and automate your deployments with a staging server.
- Apply tests to the third-party plugins you integrate into your site.
- Run tests automatically by using a Continuous Integration environment.
- Use TDD to build a REST API with a front-end Ajax interface.
The book is published under a Creative Commons license.
13. Python Data Science Handbook by Jake VanderPlas
Working scientists and data crunchers familiar with reading and writing Python code will find this comprehensive desk reference ideal for tackling day-to-day issues: manipulating, transforming, and cleaning data; visualizing different types of data; and using data to build statistical or machine learning models.
This is an excellent reference for scientific computing in Python.
With this handbook, you’ll learn how to use:
- IPython and Jupyter: provide computational environments for data scientists using Python.
- NumPy: includes the ndarray for efficient storage and manipulation of dense data arrays in Python.
- Pandas: features the DataFrame for efficient storage and manipulation of labeled/columnar data in Python.
- Matplotlib: includes capabilities for a flexible range of data visualizations in Python.
- Scikit-Learn: for efficient and clean Python implementations of the most important and established machine learning algorithms.
14. Snake Wrangling for Kids by Jason R. Briggs
Snake Wrangling for Kids is a printable electronic book, for children 8 years and older, who would like to learn computer programming. It covers the very basics of programming, and uses the Python 3 programming language to teach the concepts.
There are 3 different versions of the free book (one for Mac, one for Linux and one for Windows).
It has been rewritten and updated, with new chapters (including developing graphical games), and new code examples
- Use fundamental data structures like lists, tuples, and maps.
- Organize and reuse your code with functions and modules.
- Use control structures like loops and conditional statements.
- Draw shapes and patterns with Python’s turtle module.
- Create games, animations, and other graphical wonders with Tkinter.
This version is licensed under the Creative Commons license.
The author no longer distributes the book.
15. Make Games with Python by Sean M. Tracey
Make Games with Python aims to teach you the essential skills you’ll need to make games with Python and Pygame on a Raspberry Pi. Drawing, animation, keyboard and mouse controls, sound, and physics are given good treatment.
Although this book is designed to help you learn many of the essential skills you’ll need to make games with Python and Pygame on your Raspberry Pi, it’s by no means a definitive guide.
Read this book in conjunction with some of the books on the first page.
Chapters cover:
- Shapes and paths with Pygame – looks at drawing and coloring various shapes in a window.
- Animating shapes and paths – learn how to move shapes around the screen.
- Taking control of the keyboard and mouse – makes two simple programs to learn how to use the keyboard and mouse.
- Your first game – an old-school drop-down game where platforms rise up from the floor.
- Pygame soundboard – learn about loading and playing sounds in Pygame projects.
- Physics and forces – give game objects mass, and apply gravity.
- Physics & Collisions – create circles which can bounce off one another on collision.
- Building classes – make a simple barrel-dodging game using classes.
- The Aliens are trying to kill me – applying the techniques learned in the earlier chapters, this chapter sets out the first half of the space shooter game.
- The aliens are here & they’re coming in waves! – adds polish to the space shooter game with shields to the spaceship and a simple health/shield bar to show their status. Levels and waves for enemy spaceships are also added.
Make Games with Python is published under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License (CC BY-NC-SA 3.0).
Next page: Page 4 – Making Games with Python & Pygame and more books
Pages in this article:
Page 1 – Think Python and more books
Page 2 – Supporting Python 3 and more books
Page 3 – Invent Your Own Computer Games with Python and more books
Page 4 – Making Games with Python & Pygame and more books
Page 5 – Hacking Secret Ciphers with Python and more books
Page 6 – Learn Python, Break Python and more books
Page 7 – Modeling Creativity: Case Studies in Python and more books
Page 8 – Python in Hydrology and more books
Page 9 – Tiny Python 3.6 Notebook and more books
All books in this series:
Free Programming Books | |
---|---|
Ada | ALGOL-like programming language, extended from Pascal and other languages |
Agda | Dependently typed functional language based on intuitionistic Type Theory |
Arduino | Inexpensive, flexible, open source microcontroller platform |
Assembly | As close to writing machine code without writing in pure hexadecimal |
Awk | Versatile language designed for pattern scanning and processing language |
Bash | Shell and command language; popular both as a shell and a scripting language |
BASIC | Beginner’s All-purpose Symbolic Instruction Code |
C | General-purpose, procedural, portable, high-level language |
C++ | General-purpose, portable, free-form, multi-paradigm language |
C# | Combines the power and flexibility of C++ with the simplicity of Visual Basic |
Clojure | Dialect of the Lisp programming language |
ClojureScript | Compiler for Clojure that targets JavaScript |
COBOL | Common Business-Oriented Language |
CoffeeScript | Transcompiles into JavaScript inspired by Ruby, Python and Haskell |
Coq | Dependently typed language similar to Agda, Idris, F* and others |
Crystal | General-purpose, concurrent, multi-paradigm, object-oriented language |
CSS | CSS (Cascading Style Sheets) specifies a web page’s appearance |
D | General-purpose systems programming language with a C-like syntax |
Dart | Client-optimized language for fast apps on multiple platforms |
Dylan | Multi-paradigm language supporting functional and object-oriented coding |
ECMAScript | Best known as the language embedded in web browsers |
Eiffel | Object-oriented language designed by Bertrand Meyer |
Elixir | Relatively new functional language running on the Erlang virtual machine |
Erlang | General-purpose, concurrent, declarative, functional language |
F# | Uses functional, imperative, and object-oriented programming methods |
Factor | Dynamic stack-based programming language |
Forth | Imperative stack-based programming language |
Fortran | The first high-level language, using the first compiler |
Go | Compiled, statically typed programming language |
Groovy | Powerful, optionally typed and dynamic language |
Haskell | Standardized, general-purpose, polymorphically, statically typed language |
HTML | HyperText Markup Language |
Icon | Wide variety of features for processing and presenting symbolic data |
J | Array programming language based primarily on APL |
Java | General-purpose, concurrent, class-based, object-oriented, high-level language |
JavaScript | Interpreted, prototype-based, scripting language |
Julia | High-level, high-performance language for technical computing |
Kotlin | More modern version of Java |
LabVIEW | Designed to enable domain experts to build power systems quickly |
LaTeX | Professional document preparation system and document markup language |
Lisp | Unique features - excellent to study programming constructs |
Logo | Dialect of Lisp that features interactivity, modularity, extensibility |
Lua | Designed as an embeddable scripting language |
Markdown | Plain text formatting syntax designed to be easy-to-read and easy-to-write |
Objective-C | Object-oriented language that adds Smalltalk-style messaging to C |
OCaml | The main implementation of the Caml language |
Pascal | Imperative and procedural language designed in the late 1960s |
Perl | High-level, general-purpose, interpreted, scripting, dynamic language |
PHP | PHP has been at the helm of the web for many years |
PostScript | Interpreted, stack-based and Turing complete language |
Prolog | A general purpose, declarative, logic programming language |
PureScript | Small strongly, statically typed language compiling to JavaScript |
Python | General-purpose, structured, powerful language |
QML | Hierarchical declarative language for user interface layout - JSON-like syntax |
R | De facto standard among statisticians and data analysts |
Racket | General-purpose, object-oriented, multi-paradigm, functional language |
Raku | Member of the Perl family of programming languages |
Ruby | General purpose, scripting, structured, flexible, fully object-oriented language |
Rust | Ideal for systems, embedded, and other performance critical code |
Scala | Modern, object-functional, multi-paradigm, Java-based language |
Scheme | A general-purpose, functional language descended from Lisp and Algol |
Scratch | Visual programming language designed for 8-16 year-old children |
SQL | Access and manipulate data held in a relational database management system |
Standard ML | General-purpose functional language characterized as "Lisp with types" |
Swift | Powerful and intuitive general-purpose programming language |
Tcl | Dynamic language based on concepts of Lisp, C, and Unix shells |
TeX | Markup and programming language - create professional quality typeset text |
TypeScript | Strict syntactical superset of JavaScript adding optional static typing |
Vala | Object-oriented language, syntactically similar to C# |
VHDL | Hardware description language used in electronic design automation |
VimL | Powerful scripting language of the Vim editor |
XML | Rules for defining semantic tags describing structure ad meaning |