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.
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.
- 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).
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
|ALGOL-like programming language, extended from Pascal and other languages
|Dependently typed functional language based on intuitionistic Type Theory
|Inexpensive, flexible, open source microcontroller platform
|As close to writing machine code without writing in pure hexadecimal
|Versatile language designed for pattern scanning and processing language
|Shell and command language; popular both as a shell and a scripting language
|Beginner’s All-purpose Symbolic Instruction Code
|General-purpose, procedural, portable, high-level language
|General-purpose, portable, free-form, multi-paradigm language
|Combines the power and flexibility of C++ with the simplicity of Visual Basic
|Dialect of the Lisp programming language
|Common Business-Oriented Language
|Dependently typed language similar to Agda, Idris, F* and others
|General-purpose, concurrent, multi-paradigm, object-oriented language
|CSS (Cascading Style Sheets) specifies a web page’s appearance
|General-purpose systems programming language with a C-like syntax
|Client-optimized language for fast apps on multiple platforms
|Multi-paradigm language supporting functional and object-oriented coding
|Best known as the language embedded in web browsers
|Object-oriented language designed by Bertrand Meyer
|Relatively new functional language running on the Erlang virtual machine
|General-purpose, concurrent, declarative, functional language
|Uses functional, imperative, and object-oriented programming methods
|Dynamic stack-based programming language
|Imperative stack-based programming language
|The first high-level language, using the first compiler
|Compiled, statically typed programming language
|Powerful, optionally typed and dynamic language
|Standardized, general-purpose, polymorphically, statically typed language
|HyperText Markup Language
|Wide variety of features for processing and presenting symbolic data
|Array programming language based primarily on APL
|General-purpose, concurrent, class-based, object-oriented, high-level language
|Interpreted, prototype-based, scripting language
|High-level, high-performance language for technical computing
|More modern version of Java
|Designed to enable domain experts to build power systems quickly
|Professional document preparation system and document markup language
|Unique features - excellent to study programming constructs
|Dialect of Lisp that features interactivity, modularity, extensibility
|Designed as an embeddable scripting language
|Plain text formatting syntax designed to be easy-to-read and easy-to-write
|Object-oriented language that adds Smalltalk-style messaging to C
|The main implementation of the Caml language
|Imperative and procedural language designed in the late 1960s
|High-level, general-purpose, interpreted, scripting, dynamic language
|PHP has been at the helm of the web for many years
|Interpreted, stack-based and Turing complete language
|A general purpose, declarative, logic programming language
|General-purpose, structured, powerful language
|Hierarchical declarative language for user interface layout - JSON-like syntax
|De facto standard among statisticians and data analysts
|General-purpose, object-oriented, multi-paradigm, functional language
|Member of the Perl family of programming languages
|General purpose, scripting, structured, flexible, fully object-oriented language
|Ideal for systems, embedded, and other performance critical code
|Modern, object-functional, multi-paradigm, Java-based language
|A general-purpose, functional language descended from Lisp and Algol
|Visual programming language designed for 8-16 year-old children
|Access and manipulate data held in a relational database management system
|General-purpose functional language characterized as "Lisp with types"
|Powerful and intuitive general-purpose programming language
|Dynamic language based on concepts of Lisp, C, and Unix shells
|Markup and programming language - create professional quality typeset text
|Object-oriented language, syntactically similar to C#
|Hardware description language used in electronic design automation
|Powerful scripting language of the Vim editor
|Rules for defining semantic tags describing structure ad meaning