HELP - FTP seesions using python????????

Norbert.Klamann at pobox.com Norbert.Klamann at pobox.com
Tue Apr 27 01:29:45 EDT 1999


In article <7g328l$hga$1 at nnrp1.dejanews.com>,
  gony at my-dejanews.com wrote:
> any links or tips etc on how to tackle automation of FTP sessions using python
> would be most appreciated.
Here is a batch example, it is an extract so it comes with no warranty :)
It implements a 'put'-Operation  on a file from Windows NT to an IBM-Host


import ftplib

def doit():
  ftp = ftplib.FTP(FTPNameHost)
  ftp.login(FTPUserId,FTPPasswort)
  fileA= open(AuftragSammelDateiName,'r')
  ftp.storlines("STOR '" + AuftragHostDateiname + "'" ,fileA)
  ftp.quit()
  fileA.close()

The 'STOR'  and the "'" - Delimiters are specific for
the FTP-Implementation on an IBM Host.

Hope that helps !
--
Norbert Klamann
Klamann Software & Beratung
Erftstadt Germany
Klamann.Software at pobox.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




More information about the Python-list mailing list