<s> """<STR_LIT>""" <EOL> import os <EOL> from ftplib import FTP <EOL> def connect_to_server ( url , login , password , folder , verbose = False ) : <EOL> """<STR_LIT>""" <EOL> ftp = FTP ( url , login , password ) <EOL> if verbose == True : <EOL> print "<STR_LIT:%s>" % ftp . getwelcome ( ) <EOL> ftp . cwd ( folder ) <EOL> if verbose == True : <EOL> ftp . retrlines ( '<STR_LIT>' ) <EOL> print <EOL> return ftp <EOL> def upload_file ( filePath , FTPconnection ) : <EOL> """<STR_LIT>""" <EOL> file = open ( filePath , '<STR_LIT:rb>' ) <EOL> fileName = os . path . split ( filePath ) [ <NUM_LIT:1> ] <EOL> FTPconnection . storbinary ( '<STR_LIT>' + fileName , file ) <EOL> file . close ( ) </s>
