Deleting or renaming files

Deleting and renaming files using ftplib is mercifully simple by comparison. The delete() method takes only a filename and attempts to delete the given file on the server. The rename() method takes only a source and destination, and attempts to rename the source to the destination name.

Naturally, the success of either method depends on the permissions granted to the login account used.

Get Python GUI Programming with Tkinter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.