You should get the file list inside the directory to delete, loop ftp_delete() for each and ftp_rmdir() for each subdirectory, but they need to be empty as the main directory to delete. So it's a bit tricky, the functions you need to use are:
but in the case of rmdir and ftp_rmdir the directory needs to be always empty and you need permissions, so in some occasions you'll need to use chmod() or ftp_chmod() since the ftp user is different from the server user, usually www-data.
If you have to do a lot of this activity it could be better to place a script in the remote server, use cron to make it wait instructions and from local send a simple file or $_POST with the name of the directory to delete, you can use ftp_* or even curl. Just make sure that these ftp accounts are jailed otherwise it becomes dangerous.
root = tkinter.Tk()
buttons=[i for i in range(10)]
#If specific button is pressed, output "YES"
for num in buttons: