it' time for something realistic let' conclude this by putting some of the socket ideas we've studied to work doing something bit more useful than echoing text back and forth example - implements both the server-side and the client-side logic needed to ship requested file from server to client machines over raw socket in effectthis script implements simple file download system one instance of the script is run on the machine where downloadable files live (the server)and another on the machines you wish to copy files to (the clientscommand-line arguments tell the script which flavor to run and optionally name the server machine and port number over which conversations are to occur server instance can respond to any number of client file requests at the port on which it listensbecause it serves each in thread example - pp \internet\sockets\getfile py ""############################################################################implement client and server-side logic to transfer an arbitrary file from server to client over socketuses simple control-info protocol rather than separate sockets for control and data (as in ftp)dispatches each client request to handler threadand loops to transfer the entire file by blockssee ftplib examples for higher-level transport scheme############################################################################""import sysostime_thread as thread from socket import blksz defaulthost 'localhostdefaultport helptext ""usage server=getfile py -mode server [-port nnn[-host hhh|localhostclient=getfile py [-mode client-file fff [-port nnn[-host hhh|localhost""def now()return time asctime(def parsecommandline()dict {args sys argv[ :while len(args> dict[args[ ]args[ args args[ :return dict put in dictionary for easy lookup skip program name at front of args exampledict['-mode''serverdef client(hostportfilename)sock socket(af_inetsock_streamsock connect((hostport) network scripting