#'win 'winstart(cmdline('start % 'videotools 'linux 'cmdline('tkcvideo_c % ')'win 'winstart()imagetools 'linux 'cmdline('zimager % ')'win 'winstart()texttools 'linux 'cmdline('vi % ')'win 'cmdline('notepad % 'apptools 'win 'winstart(startfile or system zaurus pda avoid dos pop up zaurus pda zaurus pda or try pyeditdocxlsetcuse at your own riskmap mimetype of filenames to player tables mimetable {'audio'audiotools'video'videotools'image'imagetools'text'texttools'application'apptoolsnot html textbrowser #################################################################################top-level interfaces #################################################################################def trywebbrowser(filenamehelpmsg=helpmsg**options)""try to open file in web browser last resort if unknown mimetype or platformand for text/html ""trace('trying browser'filenametryplayer webbrowser(open in local browser player run(filename**optionsexceptprint(helpmsg filenameelse nothing worked def playknownfile(filenameplayertable={}**options)""play media file of known typeuses platform-specific player objectsor spawns web browser if nothing for this platformaccepts media-specific player table ""if sys platform in playertableplayertable[sys platformrun(filename**optionsspecific tool playing media files