Domanda

this code section in main() causes the problem:

config = configparser.ConfigParser()
config.read('config.ini')
ftp = ftplib.FTP("ftp.mommy.de")
username = config.get('Ftp','username')
print(username)
ftp.login(username, 'mypassword')
print(ftp.getwelcome())

If i write 'myusername' directly in ftp.login() then everything is fine. When i use the variable 'username' then the error occures again (ftplib.error_perm: 530 Login incorrect.) :(.

Can someone help me pls?

È stato utile?

Soluzione

It's my nooby fault. In the config.ini file i wrote this assignment

[Ftp]

username="username"

so when using configparser the string was "username" and not username.....

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top