dir user ('lutz'getpass('pswd?')monty python theme song getfile(filesitediruserplayfile(filefetch audio file by ftp send it to audio player import os os system('getone py sousa au'equivalent command line there' not much to this scriptbecause it really just combines two tools we've already coded we're reusing example - ' getfile to downloadand ' play file module (example - to play the audio sample after it is downloaded (turn back to that example for more details on the player part of the taskalso notice the last two lines in this file--we can achieve the same effect by passing in the audio filename as command-line argument to our original scriptbut it' less direct as isthis script assumes my ftp server accountconfigure as desired (alasthis file used to be at the ftp python org anonymous ftp sitebut that site went dark for security reasons between editions of this bookonce configuredthis script will run on any machine with pythonan internet linkand recognizable audio playerit works on my windows laptop with broadband internet connectionand it plays the music clip in windows media player (and if could insert an audio file hyperlink here to show what it sounds likei would ) :\pp \internet\ftpsousa py pswddownloading sousa au download done :\pp \internet\ftpsousa py pswdsousa au already fetched the getfile and putfile modules themselves can be used to move the sample file around too both can either be imported by clients that wish to use their functionsor run as top-level programs to trigger self-tests and command-line usage for varietylet' run these scripts from command line and the interactive prompt to see how they work when run standalonethe filename is passed in the command line to putfile and both use password input and default site settingsc:\pp \internet\ftpputfile py sousa py ftp rmi net pswduploading sousa py upload done when importedparameters are passed explicitly to functionsc:\pp \internet\ftppython from getfile import getfile getfile(file='sousa au'site='ftp rmi net'dir='user=('lutz''xxx')sousa au already fetched client-side scripting