Code samples



These samples are intended for educational use. They simply illustrate how to do certain things. They are not necessarily full applications. Some web browsers may not download the file by clicking on the link. If there is a problem then right click, command click, or click and hold in the link (browser dependant) then select "save link location as"...

Python:




Name:

Description:

Link:

StarLanes 1.0

This game is a rewrite of the old Apple// game of the same name. It is written in Python and is written in a style somewhere between that of BASIC and a structured programming language. It is fully functional but is purposely left a little rough. Please note I have set up the program to run on my computer. If it does not work on a specific machine, alter the first line so it points to the Python interpreter on that machine. Alternatively remove the first line, replace the "sh" in the file name with a "py", and run it as a standard Python script.

StarLanes-1.0.sh

StarLanes 1.1

A member of the WINNIPUG (http://www.WinniPUG.ca) submits the version 1.1 rewrite. This new version brings the program closer to the PEP8 standard (http://www.python.org/dev/peps/pep-0008/). Renaming the file to have a "py" extension means it will run as a Python script called from the command line. The user can still run it as a shell script if appropriate steps are taken. Use the right click method described above to download the file.

starlanes-1.1.py




Zenity/*NIX shell script: (still working on this section)




Name:

Description:

Link:

mp-front

This is a front end for mplayer. In essence it is an MP3 interface.

mp-front

zenbutton

A sample of the radio button option in Zenity.

zenbutton

zenfile

This is a sample using Zenity to display a file dialogue. It basically displays certain filetypes.

zenfile

zenlist1

This is the third version of a sample contact list. The other two aren't as good so they aren't here.

zenlist1

zenquestion

Poll the user for an OK/Cancel response.

zenquestion