Sample Code for Python

From SwinBrain

This page contains a number of links related to Python sample code.

Samples

  • Mathematical Vector: This class demonstrates a number of the useful Python constructs including list comprehensions and operator overloading.
  • Raytracer: This sample builds on the mathematical vector and demonstrates how to generate simple images of a three dimensional scene.
  • Soduku: This sample demonstrates how to solve the popular puzzle soduku using python.
  • pygame: A simple example which demonstrates the use of the python extension library pygame.
  • Mandelbrot: A very simple Mandelbrot set visualisation.
  • Permutations: Demonstrates how to use recursion to calculate the permutations of a python list.
  • PolygonArea: Demonstrates how to calculate the area of a convex polygon.
  • Priority Queue: Demonstrates how to use the python heapq module to produce a priority queue. Useful for many AI/Search problems

External Sample Code

[edit]Sample Code » C | C++ | .NET | Pascal | Perl | T-Sql | XHTML | Python | others to come