当前位置: 首页>>代码示例>>Python>>正文


Python messagebox.showinfo方法代码示例

本文整理汇总了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") 
开发者ID:PacktPublishing,项目名称:Tkinter-GUI-Programming-by-Example,代码行数:23,代码来源:textarea.py

示例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) 
开发者ID:PacktPublishing,项目名称:Python-GUI-Programming-with-Tkinter,代码行数:24,代码来源:application.py

示例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)) 
开发者ID:RexScratch,项目名称:sb3tosb2,代码行数:18,代码来源:sb3tosb2.py

示例4: info

# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def info(message, title="信息"):
    msgbox.showinfo(title=title, message=message) 
开发者ID:winkidney,项目名称:PickTrue,代码行数:4,代码来源:toolkit.py

示例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 
开发者ID:PacktPublishing,项目名称:Tkinter-GUI-Programming-by-Example,代码行数:12,代码来源:friendslist.py

示例6: info

# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def info(subject, text):
        messagebox.showinfo(subject, text) 
开发者ID:pabloibiza,项目名称:WiCC,代码行数:4,代码来源:wicc_view_popup.py

示例7: say_hello

# 需要导入模块: from tkinter import messagebox [as 别名]
# 或者: from tkinter.messagebox import showinfo [as 别名]
def say_hello(self):
        msgbox.showinfo("Hello", "Hello World!") 
开发者ID:PacktPublishing,项目名称:Tkinter-GUI-Programming-by-Example,代码行数:4,代码来源:ch1-5.py

示例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.") 
开发者ID:PacktPublishing,项目名称:Tkinter-GUI-Programming-by-Example,代码行数:8,代码来源:ch1-5.py

示例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) 
开发者ID:PacktPublishing,项目名称:Tkinter-GUI-Programming-by-Example,代码行数:5,代码来源:ch1-6.py

示例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) 
开发者ID:PacktPublishing,项目名称:Tkinter-GUI-Programming-by-Example,代码行数:6,代码来源:ch1-4.py

示例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!") 
开发者ID:PacktPublishing,项目名称:Tkinter-GUI-Programming-by-Example,代码行数:4,代码来源:texteditor.py

示例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) 
开发者ID:jsexauer,项目名称:networkx_viewer,代码行数:16,代码来源:viewer.py

示例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('提示', '转换成功!') 
开发者ID:jtyoui,项目名称:Jtyoui,代码行数:15,代码来源:tk.py

示例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('提示', '转换成功!') 
开发者ID:jtyoui,项目名称:Jtyoui,代码行数:12,代码来源:tk.py

示例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() 
开发者ID:int-brain-lab,项目名称:ibllib,代码行数:7,代码来源:graphic.py


注:本文中的tkinter.messagebox.showinfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。