""###########################################################################pyphoto thumbnail image viewer with resizing and saves supports multiple image directory thumb windows the initial img dir is passed in as cmd arguses "imagesdefaultor is selected via main window buttonlater directories are opened by pressing "din image view or thumbnail windows viewer also scrolls popped-up images that are too large for the screenstill to do( rearrange thumbnails when window resizedbased on current window size( [doneoption to resize images to fit current window size( avoid scrolls if image size is less than window max sizeuse label if imgwide <scrwide and imghigh <scrhighnew in updated to run in python and latest pilnew in now does form of ( aboveimage is resized to one of the display' dimensions if clickedand zoomed in or out in increments on key pressesgeneralize mecaveatseems to lose qualitypixels after many resizes (this is probably limitation of pilthe following scaler adapted from pil' thumbnail code is similar to the screen height scaler herebut only shrinksxy imgwideimghigh if scrwidey max( scrwide / ) scrwide if scrhighx max( scrhigh / ) scrhigh ###########################################################################""import sysmathos from tkinter import from tkinter filedialog import saveasdirectory from pil import image from pil imagetk import photoimage from viewer_thumbs import makethumbs pil imagealso in tkinter pil photo widget replacement developed earlier in book remember last dirs across all windows savedialog saveas(title='save as (filename gives image type)'opendialog directory(title='select image directory to open'trace print or lambda *xnone appname 'pyphoto class scrolledcanvas(canvas)"" canvas in container that automatically makes vertical and horizontal scroll bars for itself ""def __init__(selfcontainer)canvas __init__(selfcontainerself config(borderwidth= pyphotoan image viewer and resizer