canvas create_window(colposrowposanchor=nwwindow=linkwidth=linksizeheight=linksizecolpos +linksize savephotos append(photorowpos +linksize win bind(''ondirectoryopenwin savephotos savephotos return win if __name__ ='__main__'""open dir default or cmdline arg else show simple window to select ""imgdir 'imagesif len(sys argv imgdir sys argv[ if os path exists(imgdir)mainwin viewthumbs(imgdirkind=tkelsemainwin tk(mainwin title(appname 'open'handler lambdaondirectoryopen(nonebutton(mainwintext='open image directory'command=handlerpack(mainwin mainloop(pyviewan image and notes slideshow picture may be worth thousand wordsbut it takes considerably fewer to display one with python the next programpyviewimplements simple photo slideshow program in portable python/tkinter code it doesn' have any image-processing abilities such as pyphoto' resizingbut it does provide different toolssuch as image note filesand it can be run without the optional pil extension running pyview pyview pulls together many of the topics we studied in it uses after events to sequence slideshowdisplays image objects in an automatically sized canvasand so on its main window displays photo on canvasusers can either open and view photo directly or start slideshow mode that picks and displays random photo from directory at regular intervals specified with scale widget by defaultpyview slideshows show images in the book' image file directory (though the open button allows you to load images in arbitrary directoriesto view other sets of photoseither pass directory name in as first command-line argument or change the default directory name in the script itself can' show you slideshow in action herebut can show you the main window in general figure - shows the main pyviewan image and notes slideshow