42 lines
1.2 KiB
Plaintext
42 lines
1.2 KiB
Plaintext
From: Norbert.Klamann at pobox.com (Norbert.Klamann at pobox.com)
|
|
Date: Tue, 27 Apr 1999 05:29:45 GMT
|
|
Subject: HELP - FTP seesions using python????????
|
|
References: <7g328l$hga$1@nnrp1.dejanews.com>
|
|
Message-ID: <7g3i05$uo9$1@nnrp1.dejanews.com>
|
|
X-UID: 630
|
|
|
|
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
|
|
|
|
|
|
|
|
|