Python tkinter.messagebox.showinfo() Examples
The following are 30
code examples of tkinter.messagebox.showinfo().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
tkinter.messagebox
, or try the search function
.

Example #1
Source File: textarea.py From Tkinter-GUI-Programming-by-Example with MIT License | 7 votes |
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")
Example #2
Source File: textarea.py From Tkinter-GUI-Programming-by-Example with MIT License | 6 votes |
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")
Example #3
Source File: textarea.py From Tkinter-GUI-Programming-by-Example with MIT License | 6 votes |
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")
Example #4
Source File: sb3tosb2.py From sb3tosb2 with Mozilla Public License 2.0 | 6 votes |
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))
Example #5
Source File: toolkit.py From PickTrue with MIT License | 5 votes |
def info(message, title="信息"): msgbox.showinfo(title=title, message=message)
Example #6
Source File: wicc_view_popup.py From WiCC with GNU General Public License v3.0 | 5 votes |
def info(subject, text): messagebox.showinfo(subject, text)
Example #7
Source File: ch1-5.py From Tkinter-GUI-Programming-by-Example with MIT License | 5 votes |
def say_hello(self): msgbox.showinfo("Hello", "Hello World!")
Example #8
Source File: ch1-5.py From Tkinter-GUI-Programming-by-Example with MIT License | 5 votes |
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.")
Example #9
Source File: ch1-6.py From Tkinter-GUI-Programming-by-Example with MIT License | 5 votes |
def say_hello(self): message = "Hello there " + self.name_entry.get() msgbox.showinfo("Hello", message)
Example #10
Source File: ch1-4.py From Tkinter-GUI-Programming-by-Example with MIT License | 5 votes |
def say_hello(self): msgbox.showinfo("Hello", "Hello World!")
Example #11
Source File: ch1-4.py From Tkinter-GUI-Programming-by-Example with MIT License | 5 votes |
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)
Example #12
Source File: texteditor.py From Tkinter-GUI-Programming-by-Example with MIT License | 5 votes |
def show_about_page(self): msg.showinfo("About", "My text editor, version 2, written in Python3.6 using tkinter!")
Example #13
Source File: viewer.py From networkx_viewer with GNU General Public License v3.0 | 5 votes |
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)
Example #14
Source File: tk.py From Jtyoui with MIT License | 5 votes |
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('提示', '转换成功!')
Example #15
Source File: tk.py From Jtyoui with MIT License | 5 votes |
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('提示', '转换成功!')
Example #16
Source File: graphic.py From ibllib with MIT License | 5 votes |
def popup(title, msg): root = tk.Tk() root.withdraw() messagebox.showinfo(title, msg) root.quit()
Example #17
Source File: RAASNet.py From RAASNet with GNU General Public License v3.0 | 5 votes |
def register_user(self): # Check if passwords match if not self.options['reg_password'].get() == self.options['reg_check_password'].get(): messagebox.showwarning('ERROR', 'Passwords do not match!') return else: pass # Check if every entry was filled if self.options['reg_username'].get() == '' or self.options['reg_password'].get() == '' or self.options['reg_name'].get() == '' or self.options['reg_surname'].get() == '' or self.options['reg_email'].get() == '' : messagebox.showwarning("ERROR", "Not all fields were filled!") return else: pass # check if username already exists try: payload = {'user': self.options['reg_username'].get(), 'pwd': hashlib.sha256(self.options['reg_password'].get().encode('utf-8')).hexdigest(), 'name' : self.options['reg_name'].get(), 'surname' : self.options['reg_surname'].get(), 'email' : self.options['reg_email'].get()} r = requests.post('https://zeznzo.nl/reg.py', data=payload) if r.status_code == 200: if r.text.startswith('[ERROR]'): messagebox.showwarning('ERROR', r.text.split('[ERROR] ')[1]) return else: messagebox.showinfo('INFO', 'User registered!') else: messagebox.showwarning('ERROR', 'Failed to register!\n%i' % r.status_code) return except Exception as e: messagebox.showwarning('ERROR', '%s' % e) return self.reg.destroy()
Example #18
Source File: RAASNet.py From RAASNet with GNU General Public License v3.0 | 5 votes |
def delete_me(self): return messagebox.showinfo('Cannot do that', 'Please, visit: http://jezsjxtthkqhlqoc.onion/ with Tor browser and login.\n\nYou can delete your profile under the Profile section there.')
Example #19
Source File: RAASNet.py From RAASNet with GNU General Public License v3.0 | 5 votes |
def compile_decrypt(self): try: decrypt = open(self.options['decryptor_path'].get()).read() except FileNotFoundError: return messagebox.showerror('ERROR', 'File does not exist, check decryptor path!') try: if self.options['os'].get() == 'windows': py = 'pyinstaller.exe' else: py = 'pyinstaller' if not 'from tkinter.ttk import' in decrypt: tk = '' else: tk = '--hidden-import tkinter --hiddenimport tkinter.ttk --hidden-import io' if not 'from Crypto import Random' in decrypt: crypto = '' else: crypto = '--hidden-import pycryptodome' if not 'import pyaes' in decrypt: pyaes = '' else: pyaes = '--hidden-import pyaes' if not 'from pymsgbox': pymsg = '' else: pymsg = '--hidden-import pymsgbox' os.system('%s -F -w %s %s %s %s %s' % (py, tk, crypto, pyaes, pymsg, self.options['decryptor_path'].get())) messagebox.showinfo('SUCCESS', 'Compiled successfully!\nFile located in: dist/\n\nHappy Hacking!') self.comp.destroy() except Exception as e: messagebox.showwarning('ERROR', 'Failed to compile!\n\n%s' % e)
Example #20
Source File: RAASNet.py From RAASNet with GNU General Public License v3.0 | 5 votes |
def view_license(self): messagebox.showinfo('License', 'Software: Free (Public Test)\nLicense: GNU General Public License v3.0')
Example #21
Source File: ui.py From Introduction_Move37 with MIT License | 5 votes |
def show_dialog(self, text): messagebox.showinfo('Info', text)
Example #22
Source File: Main.py From python-in-practice with GNU General Public License v3.0 | 5 votes |
def help(self, event=None): paras = [ """{} is a basic plain text editor (using the UTF-8 encoding).""".format( APPNAME), """The purpose is really to show how to create a standard main-window-style application with menus, toolbars, etc., as well as showing basic use of the Text widget.""", ] messagebox.showinfo("{} — {}".format(HELP, APPNAME), "\n\n".join([para.replace("\n", " ") for para in paras]), parent=self)
Example #23
Source File: Board.py From python-in-practice with GNU General Public License v3.0 | 5 votes |
def _check_game_over(self): userWon, canMove = self._check_tiles() title = message = None if userWon: title, message = self._user_won() elif not canMove: title = "Game Over" message = "Game over with a score of {:,}.".format( self.score) if title is not None: messagebox.showinfo("{} — {}".format(title, APPNAME), message, parent=self) self.new_game() else: self.update_score()
Example #24
Source File: Main.py From python-in-practice with GNU General Public License v3.0 | 5 votes |
def help(self, event=None): paras = [ """Reads all the images in the source directory and produces smoothly scaled copies in the target directory."""] messagebox.showinfo("Help — {}".format(APPNAME), "\n\n".join([para.replace("\n", " ") for para in paras]), parent=self)
Example #25
Source File: Main.py From python-in-practice with GNU General Public License v3.0 | 5 votes |
def help(self, event=None): paras = [ """{} is a basic plain text editor (using the UTF-8 encoding).""".format( APPNAME), """The purpose is really to show how to create a standard main-window-style application with menus, toolbars, dock windows, etc., as well as showing basic use of the Text widget.""", ] messagebox.showinfo("{} — {}".format(HELP, APPNAME), "\n\n".join([para.replace("\n", " ") for para in paras]), parent=self)
Example #26
Source File: barcode-generator-macos.py From Barcode-generator with GNU General Public License v3.0 | 5 votes |
def savebarcode(self, bcodevalue, autoname=False): savestate = False fname = "" if autoname: fname = self.filedir + '/' + bcodevalue + '.' + self.filetype.lower() else: fname = fdial.asksaveasfilename( defaultextension='png', parent=self.master, title='Saving barcode', filetypes=[ ('PNG', '*.png'), ('JPEG', '*.jpg *.jpeg'), ('GIF', '*.gif'), ('Adobe PDF', '*.pdf'), ('Barcha fayllar', '*.*')]) if(fname): tmpbarcode = self.generatebarcode(bcodevalue) tmpbarcode.filename = fname savestate = tmpbarcode.validate_create_barcode() if(not savestate): mbox.showerror("Warning", "Barcode saving error") else: mbox.showinfo("Info", "Barcode is saved as file successfully")
Example #27
Source File: barcode-generator-Windows.py From Barcode-generator with GNU General Public License v3.0 | 5 votes |
def savebarcode(self, bcodevalue, autoname=False): savestate = False; fname = ""; if autoname: fname = self.filedir+'/'+ bcodevalue + '.' + self.filetype.lower() else: fname = fdial.asksaveasfilename(defaultextension='png', parent=self.master, title='Saving barcode', filetypes=[('PNG','*.png'), ('JPEG','*.jpg *.jpeg'), ('GIF','*.gif'), ('Adobe PDF','*.pdf'), ('Barcha fayllar','*.*')]); if(fname): tmpbarcode = self.generatebarcode(bcodevalue) tmpbarcode.filename = fname; savestate = tmpbarcode.validate_create_barcode(); if(not savestate): mbox.showerror("Warning", "Barcode saving error"); else: mbox.showinfo("Info", "Barcode saved as file successfully");
Example #28
Source File: barcode-generator-Linux.py From Barcode-generator with GNU General Public License v3.0 | 5 votes |
def savebarcode(self, bcodevalue, autoname=False): savestate = False; fname = ""; if autoname: fname = self.filedir+'/'+ bcodevalue + '.' + self.filetype.lower() else: fname = fdial.asksaveasfilename(defaultextension='png', parent=self.master, title='Saving barcode', filetypes=[('PNG','*.png'), ('JPEG','*.jpg *.jpeg'), ('GIF','*.gif'), ('Adobe PDF','*.pdf'), ('Barcha fayllar','*.*')]); if(fname): tmpbarcode = self.generatebarcode(bcodevalue) tmpbarcode.filename = fname; savestate = tmpbarcode.validate_create_barcode(); if(not savestate): mbox.showerror("Warning", "Barcode saving error"); else: mbox.showinfo("Info", "Barcode is saved as file successfully");
Example #29
Source File: views.py From Python-GUI-Programming-with-Tkinter with MIT License | 5 votes |
def show_about(self): """Show the about dialog""" about_message = 'ABQ Data Entry' about_detail = ( 'by Alan D Moore\n' 'For assistance please contact the author.' ) messagebox.showinfo(title='About', message=about_message, detail=about_detail)
Example #30
Source File: mainmenu.py From Python-GUI-Programming-with-Tkinter with MIT License | 5 votes |
def show_about(self): """Show the about dialog""" about_message = 'ABQ Data Entry' about_detail = ( 'by Alan D Moore\n' 'For assistance please contact the author.' ) messagebox.showinfo( title='About', message=about_message, detail=about_detail )