""from form import form from tkinter import tkmainloop from tkinter messagebox import showinfo import getfileos class getfileform(form)def __init__(selfoneshot=false)root tk(root title('getfilegui'labels ['server name''port number''file name''local dir?'form __init__(selflabelsrootself oneshot oneshot def onsubmit(self)form onsubmit(selflocaldir self content['local dir?'get(portnumber self content['port number'get(servername self content['server name'get(filename self content['file name'get(if localdiros chdir(localdirportnumber int(portnumbergetfile client(servernameportnumberfilenameshowinfo('getfilegui''download complete'if self oneshottk(quit(else stay in last localdir if __name__ ='__main__'getfileform(mainloop(the form layout class imported here can be used by any program that needs to input form-like datawhen used in this scriptwe get user interface like that shown in figure - under windows (and similar on other versions and platformsfigure - getfilegui in action pressing this form' submit button or the enter key makes the getfilegui script call the imported getfile client client-side function as before this timethoughwe also simple python file server