internet application programming transfercmd(command [rest]initiates transfer over the ftp data connection if active mode is being usedthis sends 'portor 'eprtcommand and accepts the resulting connection from the server if passive mode is being usedthis sends 'epsvor 'pasvcommand followed by connection to the server in either caseonce the data connection has been establishedthe ftp command in command is then issued this function returns socket object corresponding to the open data connection the optional rest parameter specifies starting byte offset into files requested on the server howeverthis is not supported on all servers and could result in an error_reply exception example the following example shows how to use this module to upload file to ftp serverhost "ftp foo comusername "davepassword " filename "somefile datimport ftplib ftp_serv ftplib ftp(host,username,passwordopen the file you want to send open(filename,"rb"send it to the ftp server resp ftp_serv storbinary("stor "+filenamefclose the connection ftp_serv close to fetch documents from an ftp serveruse the urllib package for exampletryfrom urllib request import urlopen except importerrorfrom urllib import urlopen python python urlopen("ftp://username:password@somehostname/somefile"contents read(http package the http package consists of modules for writing http clients and servers as well as support for state management (cookiesthe hypertext transfer protocol (httpis simple text-based protocol that works as follows client makes connection to an http server and sends request header of the following formget /document html http/ connectionkeep-alive user-agentmozilla/ [en( usunos sun uhostrustler cs uchicago edu: acceptimage/gifimage/ -xbitmapimage/jpegimage/pjpegimage/png*/accept-encodinggzip accept-languageen accept-charsetiso- - ,*,utf- optional data lib fl ff