following downloads an image file (by defaultfrom remote ftp site opens the downloaded file with utility we wrote in example - in the download portion will run on any machine with python and an internet connectionthough you'll probably want to change the script' settings so it accesses server and file of your own the opening part works if your playfile py supports your platformsee for detailsand change as needed example - pp \internet\ftp\getone py #!/usr/local/bin/python "" python script to download and play media file by ftp uses ftplibthe ftp protocol handler which uses sockets ftp runs on sockets (one for dataone for control--on ports and and imposes message text formatsbut python' ftplib module hides most of this protocol' details change for your site/file ""import ossys from getpass import getpass from ftplib import ftp hidden password input socket-based ftp tools nonpassive false filename 'monkeys jpgdirname sitename 'ftp rmi netuserinfo ('lutz'getpass('pswd?')if len(sys argv filename sys argv[ force active mode ftp for serverfile to be downloaded remote directory to fetch from ftp site to contact use (for anonymous filename on command lineprint('connecting 'connection ftp(sitenameconnection login(*userinfoconnection cwd(dirnameif nonpassiveconnection set_pasv(falseconnect to ftp site default is anonymous login xfer at time to localfile force active ftp if server requires print('downloading 'localfile open(filename'wb'local file to store download connection retrbinary('retr filenamelocalfile write connection quit(localfile close(if input('open file?'in [' '' ']from pp system media playfile import playfile playfile(filenamemost of the ftp protocol details are encapsulated by the python ftplib module imported here this script uses some of the simplest interfaces in ftplib (we'll see others later in this but they are representative of the module in general transferring files with ftplib