'Trying to copy a file from a server/machine using Python
I am new to Python, so I apologise if I'm asking a stupid question, but I'm struggling with this atm. I am trying to copy a folder (MachineArchiveDailyBackUp) from a machine which is using Windows CE and put it onto my Windows laptop on the C: I get the error at the bottom. Can anyone give me some pointers if possible please as to where I've gone wrong in the code?
Code:
from ftplib import FTP
ip="XX.XX.XX.XX"
password='xxxx'
username= 'Robot'
mypath='C:\\Test\\robotbackup'
ftp=FTP(ip)
ftp.login(username,password)
files=ftp.dir('hd0a/BACKUP/MachineArchiveDailyBackUp')
Error:
Traceback (most recent call last):
File "c:\Users\User\Import Script.py", line 9, in <module>
ftp.login(username,password)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\ftplib.py", line 414, in login
resp = self.sendcmd('PASS ' + passwd)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\ftplib.py", line 281, in sendcmd
return self.getresp()
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\ftplib.py", line 254, in getresp
raise error_perm(resp)
ftplib.error_perm: 501 Invalid number of arguments '0' for command 'PASS', min arg = 1, max arg = 1
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
