MultiTouchPictures

Note: this tutorial is incomplete !

Code

from pymt import *
import os

# replace with the directory you want to use
PICTURE_DIRECTORY = "C:\\Users\\Public\\Pictures\\Sample Pictures"

window = getWindow()

for filename in os.listdir(PICTURE_DIRECTORY):
   image = MTScatterImage(file=filename)
   window.add_widget(image)

runTouchApp()

Discussion

This is definitely a classic example in the multitouch demo world. Almost all software kits show off this example. But with PyMT you will see how easy and simple it is to create such a application. The above source code does the same.

from pymt import *

As usual this line imports the PyMT package.

import os

This imports a python package called os. One of the functions in this package is used for fetching the paths to the image files.