danke für die infos, hat auch größtenteils geklappt nur mit einer nicht:
#dateiname:upload.py
Code: Alles auswählen
import sys, os
from ftplib import FTP
server = 'xxx'
username = 'xxx'
password = 'xxx'
def upload(fname):
#remote_folder = "temporary" #wunschordner
name = os.path.basename(fname) #filename fetchen
name = name.replace(" ","-") #bindestriche ersetzen fuer besseres web-handling
#Connect to server
ftp = FTP(server)
ftp.login(username, password)
#ftp.cwd('public_html/'+remote_folder) #wechsel zu remote_folder
#ftp.retrlines('LIST') #ausfuehrliches dir listing um ordnerberechtigungen zu ueberpruefen
#Upload the file to the server
print "Hochladen...",
ftp.storbinary("STOR "+name, open(fname,"rb"))
ftp.close()
print "Fertig!"
upload(sys.argv[1])
Code: Alles auswählen
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "C:\Python26\pyinstaller-1.3\iu.py", line 312, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "C:\Python26\pyinstaller-1.3\iu.py", line 398, in doimport
exec co in mod.__dict__
File "C:\Python26\pyinstaller-1.3\upload\buildupload\out1.pyz/ftplib", line 46, in <module>
File "C:\Python26\pyinstaller-1.3\iu.py", line 312, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "C:\Python26\pyinstaller-1.3\iu.py", line 398, in doimport
exec co in mod.__dict__
File "C:\Python26\pyinstaller-1.3\upload\buildupload\out1.pyz/socket", line 46, in <module>
File "C:\Python26\pyinstaller-1.3\iu.py", line 312, in importHook
mod = _self_doimport(nm, ctx, fqname)
File "C:\Python26\pyinstaller-1.3\iu.py", line 382, in doimport
mod = director.getmod(nm)
File "C:\Python26\pyinstaller-1.3\iu.py", line 215, in getmod
mod = owner.getmod(nm)
File "C:\Python26\pyinstaller-1.3\iu.py", line 77, in getmod
mod = imp.load_module(nm, fp, attempt, (ext, mode, typ))
ImportError: DLL load failed: The specified module could not be found.