本文整理汇总了Python中tkinter.messagebox.showinfo方法的典型用法代码示例。如果您正苦于以下问题:Python messagebox.showinfo方法的具体用法?Python messagebox.showinfo怎么用?Python messagebox.showinfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.messagebox
的用法示例。
在下文中一共展示了messagebox.showinfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: find
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def find(self, text_to_find):
length = tk.IntVar()
idx = self.search(text_to_find, self.find_search_starting_index, stopindex=tk.END, count=length)
if idx:
self.tag_remove('find_match', 1.0, tk.END)
end = f'{idx}+{length.get()}c'
self.tag_add('find_match', idx, end)
self.see(idx)
self.find_search_starting_index = end
self.find_match_index = idx
else:
if self.find_match_index != 1.0:
if msg.askyesno("No more results", "No further matches. Repeat from the beginning?"):
self.find_search_starting_index = 1.0
self.find_match_index = None
return self.find(text_to_find)
else:
msg.showinfo("No Matches", "No matching text found")
示例2: check_queue
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def check_queue(self, queue):
if not queue.empty():
item = queue.get()
if item.status == 'done':
messagebox.showinfo(
item.status,
message=item.subject,
detail=item.body
)
self.status.set(item.subject)
return
elif item.status == 'error':
messagebox.showerror(
item.status,
message=item.subject,
detail=item.body
)
self.status.set(item.subject)
return
else:
self.status.set(item.body)
self.after(100, self.check_queue, queue)
示例3: success
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def success(sb2path, warnings, gui):
if gui:
if warnings == 0:
messagebox.showinfo("Success", "Completed with no warnings")
elif warnings == 1:
messagebox.showinfo("Success", "Completed with {} warning".format(warnings))
else:
messagebox.showinfo("Success", "Completed with {} warnings".format(warnings))
else:
print('')
if warnings == 0:
print("Saved to '{}' with no warnings".format(sb2path))
elif warnings == 1:
print("Saved to '{}' with {} warning".format(sb2path, warnings))
else:
print("Saved to '{}' with {} warnings".format(sb2path, warnings))
示例4: info
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def info(message, title="信息"):
msgbox.showinfo(title=title, message=message)
示例5: add_friend
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def add_friend(self, username):
if self.requester.add_friend(self.username, username):
msg.showinfo("Friend Added", "Friend Added")
success = True
self.reload_friends()
else:
msg.showerror("Add Failed", "Friend was not found")
success = False
return success
示例6: info
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def info(subject, text):
messagebox.showinfo(subject, text)
示例7: say_hello
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def say_hello(self):
msgbox.showinfo("Hello", "Hello World!")
示例8: say_goodbye
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def say_goodbye(self):
if msgbox.askyesno("Close Window?", "Would you like to close this window?"):
self.label_text.set("Window will close in 2 seconds")
self.after(2000, self.destroy)
else:
msgbox.showinfo("Not Closing", "Great! This window will stay open.")
示例9: say_hello
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def say_hello(self):
message = "Hello there " + self.name_entry.get()
msgbox.showinfo("Hello", message)
示例10: say_goodbye
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def say_goodbye(self):
self.label_text.set("Window will close in 2 seconds")
msgbox.showinfo("Goodbye!", "Goodbye, it's been fun!")
self.after(2000, self.destroy)
示例11: show_about_page
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def show_about_page(self):
msg.showinfo("About", "My text editor, version 2, written in Python3.6 using tkinter!")
示例12: filter_help
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def filter_help(self, event=None):
msg = ("Enter a lambda function which returns True if you wish\n"
"to show nodes with ONLY a given property.\n"
"Parameters are:\n"
" - u, the node's name, and \n"
" - d, the data dictionary.\n\n"
"Example: \n"
" d.get('color',None)=='red'\n"
"would show only red nodes.\n"
"Example 2:\n"
" str(u).is_digit()\n"
"would show only nodes which have a numerical name.\n\n"
"Multiple filters are ANDed together.")
tkm.showinfo("Filter Condition", msg)
示例13: image_pdf
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def image_pdf(file_dir):
dir_name, base_name = get_dir_name(file_dir)
doc = fitz.Document()
for img in sorted(glob.glob(file_dir + '\\*'), key=os.path.getmtime): # 排序获得对象
img_doc = fitz.Document(img) # 获得图片对象
pdf_bytes = img_doc.convertToPDF() # 获得图片流对象
img_pdf = fitz.Document("pdf", pdf_bytes) # 将图片流创建单个的PDF文件
doc.insertPDF(img_pdf) # 将单个文件插入到文档
img_doc.close()
img_pdf.close()
doc.save(dir_name + os.sep + base_name + ".pdf") # 保存文档
doc.close()
messagebox.showinfo('提示', '转换成功!')
示例14: pdf_image
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def pdf_image(pdf_name):
dir_name, base_name = get_dir_name(pdf_name)
pdf = fitz.Document(pdf_name)
for pg in range(0, pdf.pageCount):
page = pdf[pg] # 获得每一页的对象
trans = fitz.Matrix(1.0, 1.0).preRotate(0)
pm = page.getPixmap(matrix=trans, alpha=False) # 获得每一页的流对象
pm.writePNG(FILE[:-4] + os.sep + base_name[:-4] + '_{:0>4d}.png'.format(pg + 1)) # 保存图片
pdf.close()
messagebox.showinfo('提示', '转换成功!')
示例15: popup
# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def popup(title, msg):
root = tk.Tk()
root.withdraw()
messagebox.showinfo(title, msg)
root.quit()