On Fri, Jun 17, 2016 at 12:46 PM boB Stepp <[email protected]> wrote:
> ftp = FTP('ip_address', 'username', 'password')
>
> Or
>
> ftp = FTP('ip_address')
> ftp.login('username', 'password')
>
> Most of the examples I am seeing online use the second approach. Is
> there some reason why this is to be preferred?
Not that I can see. Perhaps only to show that the login method exists.
I suggest using it in a context manager.
py> with FTP('ftp.example.com', 'username', 'password') as ftp:
... ftp.dir()
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor