-
as seen on Stack Overflow
- Search for 'Stack Overflow'
My python2 script uploads files nicely using this method but python3 is presenting problems and I'm stuck as to where to go next (googling hasn't helped).
from ftplib import FTP
ftp = FTP(ftp_host, ftp_user, ftp_pass)
ftp.storbinary('STOR myfile.txt', open('myfile.txt'))
The error I get is
Traceback…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm trying to do multithread uploads, but get errors.
I guessed that maybe it's impossible to use multithreads with ftplib?
Here comes my code:
class myThread (threading.Thread):
def __init__(self, threadID, src, counter, image_name):
self.threadID = threadID
self.src = src
…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'd like to download a directory and all of its contents to the local HD.
Here's the code I have thus far (crashes if there's a sub-directory, else grabs all the files):
import ftplib
import configparser
import os
def runBackups():
#Load INI
filename = 'connections.ini'
config = configparser…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have been playing around with Python's FTP library and am starting to think that it is too slow as compared to using a script file in DOS? I run sessions where I download thousands of data files (I think I have over 8 million right now). My observation is that the download process seems to take…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'd like to use ftplib to upload program-generated data as lists. The nearest method I can see for doing this is ftp.storlines, but this requires a file object with a readlines() method.
Obviously I could create a file, but this seems like overkill as the data isn't persistent.
Is there anything…
>>> More