如何在tkinter askquestion提示中更改是/否选项?

时间:2018-03-29 17:33:34

标签: python tkinter tkmessagebox

我有一个tkinter对话框,使用class User(AbstractBaseUser, PermissionsMixin): email = models.EmailField(unique=True, error_messages={'unique':"This email has already been registered."}) username = models.CharField(max_length=40, default='') first_name = models.CharField(max_length=40, default='', blank=True) last_name = models.CharField(max_length=40, default='', blank=True) date_joined = models.DateTimeField(default=timezone.now) favorites = models.ManyToManyField(Deal, related_name='favorited_by', null=True, blank=True) is_active = models.BooleanField(default=True) is_staff = models.BooleanField(default=False) objects = UserManager() USERNAME_FIELD = 'email' REQUIRED_FIELDS = ['username'] 询问用户是否要删除文件。

messagebox.askquestion

我不想使用是/否作为我的选项,而是想要将它们更改为明确说出删除/取消。

如何修改from tkinter import messagebox choice = messagebox.askquestion("Delete file", "Are you sure you want to delete this file?") if choice == 'yes': print("Delete file") 提示中的是/否选项?

"Are you sure you want to delete this file?"

0 个答案:

没有答案