One major reason to account for the wide adoption of Python is its large Standard Library. The library makes it easy to code for applications involving regular expressions, general documentation, unit testing, threading, data bases, web browser, GUI and many others. Besides the Standard library, Python is also supported by other high quality libraries such as pygame, which has useful modules to make coding video games a much easier affair.  Check Python Package Index for complete listing of these libraries.

In the following example, the Tic Tac Toe game is coded in Python and makes use of the various pygame modules to build the GUI and multi-media aspects of the game. The complete coding of Tic Tac Toe game is shown below.

Since the game is designed in object oriented programming, it would be easy to instantiate multiple Tic Tac Toe objects. With Python’s multi-threading capability, many Tic Tac Toe games can be played at the same time.

tictactoe codes p1tictactoe codes p2tictactoe codes p3tictactoe codes p4

Tic Tac Toe coded in Python