Program Arcade Games
With Python And Pygame

Download all these examples along with supporting files in a zip file: python_examples.zip.

Lab 16: Non-graphic Python Examples

MPG
Program that calculates miles-per-gallon. (Chapter 1)
calculate_miles_per_gallon.py
MPG
Calculates the kinetic energy of an object. (Chapter 1)
calculate_kinetic_energy.py
MPG
Simple example if statements. (Chapter 3)
if_statement_examples.py
MPG
Simple example for loops. (Chapter 4)
for_loop_examples.py
MPG
Simple example while loops. (Chapter 4)
while_loop_examples.py
MPG
Simple example for encrypting text. (Chapter 7)
simple_encryption.py
MPG
Simple example for decrypting text. (Chapter 7)
simple_decryption.py

Creating an Installer

Python Pygame Installer Tutorial- Create an installer for your Python program. Allow other people to play your game too!

Searching and Sorting Examples

example_sorted_names.txt - Sample file of names used in searching_example.py

searching_example.py - Example linear and binary searches

property_check_examples.py - Check a list to find items that match a property

AliceInWonderLand.txt - Text of Alice In Wonderland. Source: Project Gutenberg

AliceInWonderLand200.txt

dictionary.txt

sorting_examples.py - Example code for the insertion and selection sorts.

File Examples

high_score.py - Example that shows how to read and write a high score to the disk so that it persists between program runs.



Copyright © 2017
English version by Paul Vincent Craven
Spanish version by Antonio Rodríguez Verdugo
Russian version by Vladimir Slav
Turkish version by Güray Yildirim
Portuguese version by Armando Marques Sobrinho and Tati Carvalho
Dutch version by Frank Waegeman
Hungarian version by Nagy Attila
Finnish version by Jouko Järvenpää
French version by Franco Rossi
Korean version by Kim Zeung-Il
Chinese version by Kai Lin

AltStyle によって変換されたページ (->オリジナル) /