The module pyseq.py provides Python bindings to a large
part of the ALSA sequencer API, including the full sequencer event
struct, sequencers, queues, and ports. It comes with a simple MIDI
file player, midiplayer.py, that may serve as a tutorial.
The module pyrobot.py mimics some of the behavior of Java's
java.awt.Robot. In order to get started with it, just look at the main
routine of pyrobot.py.