Python tkinter.messagebox.showwarning() Examples

The following are 30 code examples of tkinter.messagebox.showwarning(). 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: gui.py    From snn_toolbox with MIT License 7 votes vote down vote up
def start_processing(self):
        """Start processing."""
        if self.settings['filename_ann'].get() == '':
            messagebox.showwarning(title="Warning",
                                   message="Please specify a filename base.")
            return

        if self.settings['dataset_path'].get() == '':
            messagebox.showwarning(title="Warning",
                                   message="Please set the dataset path.")
            return

        self.store_last_settings = True
        self.save_settings()
        self.check_runlabel(self.settings['runlabel'].get())
        self.config.read_dict(self.settings)

        self.initialize_thread()
        self.process_thread.start()
        self.toggle_start_state(True)
        self.update() 
Example #2
Source File: SkyFit.py    From RMS with GNU General Public License v3.0 6 votes vote down vote up
def prevImg(self):
        """ Shows the previous FF file in the list. """

        # Don't allow image change while in star picking mode
        if self.star_pick_mode:
            messagebox.showwarning(title='Star picking mode', message='You cannot cycle through images while in star picking mode!')
            return


        self.img_handle.prevChunk()

        # Reset paired stars
        self.paired_stars = []
        self.residuals = None

        self.updateImage() 
Example #3
Source File: convert_tool.py    From Resource-Pack-Converter with MIT License 6 votes vote down vote up
def selectPack():
    global pack
    pack = filedialog.askopenfilename(initialdir = "./",title = "Select Pack",filetypes = (("resource pack","*.zip"),("all files","*.*")))
    if(pack):
        root.withdraw()
        convert = main(pack[:-4])
        if(convert == -1):
            print ("this pack is already compatible with 1.13")
            root.deiconify()
            center_window(root, 270, 120)
            messagebox.showwarning(title='warning', message="This pack is already compatible with 1.13, please select other!")
        elif(convert == 0):
            print ("please set it manually")
            res_win.deiconify()
            center_window(res_win, 270, 80)
            messagebox.showwarning(title='warning', message="Fail to detect the pack's resolution, please set it manually!")
        else:
            print ("next one?")
            root.deiconify()
            center_window(root, 270, 120)
            messagebox.showinfo(title='success', message='Conversion is Done!')
            return False

    else:
        print ('select pack to start conversion') 
Example #4
Source File: hooqgui.py    From SpamSms with MIT License 6 votes vote down vote up
def clicked():
	try:
		for i in range(int(jlm.get())):
			if int(jlm.get()) > 25:
				messagebox.showwarning('Kebanyakan bosque', 'Jangan kebanyakan ntar coid -_-')
				break
			br.open('https://authenticate.hooq.tv/signupmobile?returnUrl=https://m.hooq.tv%2Fauth%2Fverify%2Fev%2F%257Cdiscover&serialNo=c3125cc0-f09d-4c7f-b7aa-6850fabd3f4e&deviceType=webClient&modelNo=webclient-aurora&deviceName=webclient-aurora/production-4.2.0&deviceSignature=02b480a474b7b2c2524d45047307e013e8b8bc0af115ff5c3294f787824998e7')
			br.select_form(nr=0)
			br.form["mobile"] = str(int(no.get()))
#			br.form["password"] = "VersiGUIlebihgudea"
			res=br.submit().read()
			if 'confirmotp' in str(res):
				stat=f"[{str(i+1)}] sukses mengirim OTP ke {no.get()}\n"
			else:
				stat=f"[{str(i+1)}] gagal mengirim OTP ke {no.get()}\n"
			time.sleep(1)
			Tex.insert(END, stat)
	except ValueErrora:
		messagebox.showerror('Value Error','Input angka!!! -_-')
	except:
		messagebox.showerror('Connection Error','Sepertinya ada yang salah. coba:\nPriksa koneksi internet anda atau\nLaporkan ke author') 
Example #5
Source File: OpenTool.py    From Open-Manager with MIT License 6 votes vote down vote up
def deleteitem(self):
        index = self.listbox.curselection()
        try:
            item = self.listbox.get(index)
        except TclError:
            messagebox.showinfo('提示', '请选择需删除的项目!')
            # messagebox.showwarning('警告','请选择需删除的项目!')
            return

        if messagebox.askyesno('删除', '删除 %s ?' % item):
            self.listbox.delete(index)
            del self.urllist[item]
            messagebox.showinfo('提示', '删除成功')
        else:
            # messagebox.showinfo('No', 'Quit has been cancelled')
            return

        # for item in index:
        #     print(self.listbox.get(item))
        #     self.listbox.delete(item)
        # print(index)
        # urlname = self.listbox.get(self.listbox.curselection())
        # print(urlname) 
Example #6
Source File: app.py    From subfinder with MIT License 6 votes vote down vote up
def _start(self):
        if not self.videofile:
            messagebox.showwarning('提示', '请先选择视频文件或目录')
            return

        def start(*args, **kwargs):
            subfinder = SubFinder(*args, **kwargs)
            subfinder.start()
            subfinder.done()

        subsearchers = [
            get_subsearcher('shooter'), 
            get_subsearcher('zimuku'),
            get_subsearcher('zimuzu')
        ]
        t = Thread(target=start, args=[self.videofile, ], kwargs=dict(
            logger_output=self._output, subsearcher_class=subsearchers))
        t.start() 
Example #7
Source File: SkyFit.py    From RMS with GNU General Public License v3.0 6 votes vote down vote up
def nextImg(self):
        """ Shows the next FF file in the list. """

        # Don't allow image change while in star picking mode
        if self.star_pick_mode:
            messagebox.showwarning(title='Star picking mode', message='You cannot cycle through images while in star picking mode!')
            return

            
        self.img_handle.nextChunk()

        # Reset paired stars
        self.paired_stars = []
        self.residuals = None

        self.updateImage() 
Example #8
Source File: pdfviewer.py    From pdfviewer with MIT License 5 votes vote down vote up
def _prev_file(self):
        if self.pdf is None:
            return
        if self.pathidx == 0:
            messagebox.showwarning("Warning", "Reached the end of list")
            return
        self.pathidx -= 1
        self._load_file() 
Example #9
Source File: workbench.py    From thonny with MIT License 5 votes vote down vote up
def _make_sanity_checks(self):
        home_dir = os.path.expanduser("~")
        bad_home_msg = None
        if home_dir == "~":
            bad_home_msg = "Can not find your home directory."
        elif not os.path.exists(home_dir):
            bad_home_msg = "Reported home directory (%s) does not exist." % home_dir
        if bad_home_msg:
            messagebox.showwarning(
                "Problems with home directory",
                bad_home_msg + "\nThis may cause problems for Thonny.",
            ) 
Example #10
Source File: process_view.py    From rabbitVE with GNU General Public License v3.0 5 votes vote down vote up
def work(self):
        self._work()
        self.exit()
        if self.safe_exit:
            messagebox.showinfo("Info", "Done.")
        else:
            messagebox.showwarning("Warning", "Not safe exit.") 
Example #11
Source File: chapter4_01.py    From Tkinter-GUI-Application-Development-Cookbook with MIT License 5 votes vote down vote up
def show_warning(self):
        msg = "Temporary files have not been correctly removed"
        mb.showwarning("Warning", msg) 
Example #12
Source File: spgl.py    From Projects with GNU General Public License v3.0 5 votes vote down vote up
def show_warning(self, title, message):
        return messagebox.showwarning(title, message) 
Example #13
Source File: run this one.py    From my_research with Apache License 2.0 5 votes vote down vote up
def button_load_learning_result_clicked(self):
        global episode
        initialdir = os.path.dirname(os.path.realpath(__file__))
        while True:
            if platform.system() == 'Darwin':
                q_index_path = askopenfilename(initialdir=initialdir, message='Choose q_index',
                                       filetypes=[('pickle files', '*.pickle'),
                                                  ("All files", "*.*") ])
            else:
                q_index_path = askopenfilename(initialdir=initialdir, title='Choose q_index',
                                       filetypes=[('pickle files', '*.pickle'),
                                                  ("All files", "*.*") ])
            if 'q_index' not in q_index_path:
                messagebox.showwarning(message='Wrong file.')
            else:
                break
        while True:
            if platform.system() == 'Darwin':
                q_table_path = askopenfilename(initialdir=initialdir, message='Choose q_table',
                                       filetypes=[('pickle files', '*.pickle'),
                                                  ("All files", "*.*") ])
            else:
                q_table_path = askopenfilename(initialdir=initialdir, title='Choose q_table',
                                       filetypes=[('pickle files', '*.pickle'),
                                                  ("All files", "*.*") ])
            if 'q_table' not in q_table_path:
                messagebox.showwarning(message='Wrong file.')
            else:
                break

        try:
            hunter.q_table = pd.read_pickle(q_table_path)
            hunter.q_index = pd.read_pickle(q_index_path)
            episode = [int(d) for d in q_table_path.split('_') if d.isdigit()][0]
            self.label_episode_v.set('Episode: %s' % episode)
        except Exception as e:
            messagebox.showerror(message=e) 
Example #14
Source File: launcher.py    From timeflux with MIT License 5 votes vote down vote up
def _on_closing(self):
        if self.running:
            messagebox.showwarning('Warning', 'A Timeflux instance is running. Please stop it before quitting.')
        else:
            self.window.destroy() 
Example #15
Source File: dialog.py    From guizero with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def warn(title, text, master=None):
    """
    Display a warning message box.

    :param string title:
        The title to be displayed on the box.
    :param string text:
        The text to be displayed on the box.
    :param App master:
        Optional guizero master which the popup will be placed over. Defaults
        to `None`.
    :return:
        None.
    """
    messagebox.showwarning(title, text, parent=None if master is None else master.tk) 
Example #16
Source File: db_update.py    From nekros with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def action(self):
        # 1 = True    &   2 = False
        if self.cb1.get() == 1:
            self.payment_success()
        elif self.cb2.get() == 1:
            self.delete_1_record()
        elif self.cb3.get() ==1:
            self.retrive_decryption_key()
        elif self.cb4.get() == 1:
            ans = tmsg.askyesnocancel("Questions", "You are Going to Delete All Records, Are U Sure & Want to do this?")
            if ans == True:            
                self.delete_all_record() 
            elif ans == False:
                tmsg.showwarning("Warning", "Don't Tick this option, If you don't want to erase all DB_Records!") 
Example #17
Source File: simpledialog.py    From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 5 votes vote down vote up
def validate(self):
        try:
            result = self.getresult()
        except ValueError:
            messagebox.showwarning(
                "Illegal value",
                self.errormessage + "\nPlease try again",
                parent = self
            )
            return 0

        if self.minvalue is not None and result < self.minvalue:
            messagebox.showwarning(
                "Too small",
                "The allowed minimum value is %s. "
                "Please try again." % self.minvalue,
                parent = self
            )
            return 0

        if self.maxvalue is not None and result > self.maxvalue:
            messagebox.showwarning(
                "Too large",
                "The allowed maximum value is %s. "
                "Please try again." % self.maxvalue,
                parent = self
            )
            return 0

        self.result = result

        return 1 
Example #18
Source File: gui.py    From snn_toolbox with MIT License 5 votes vote down vote up
def check_path(self, p):
        """Check path."""
        if not self.initialized:
            result = True
        elif not os.path.exists(p):
            msg = "Failed to set working directory:\n" + \
                  "Specified directory does not exist."
            messagebox.showwarning(title="Warning", message=msg)
            result = False
        elif self.settings['model_lib'].get() == 'caffe':
            if not any(fname.endswith('.caffemodel') for fname in
                       os.listdir(p)):
                msg = "No '*.caffemodel' file found in \n {}".format(p)
                messagebox.showwarning(title="Warning", message=msg)
                result = False
            elif not any(fname.endswith('.prototxt') for fname in
                         os.listdir(p)):
                msg = "No '*.prototxt' file found in \n {}".format(p)
                messagebox.showwarning(title="Warning", message=msg)
                result = False
            else:
                result = True
        elif not any(fname.endswith('.json') for fname in os.listdir(p)):
            msg = "No model file '*.json' found in \n {}".format(p)
            messagebox.showwarning(title="Warning", message=msg)
            result = False
        else:
            result = True

        if result:
            self.settings['path_wd'].set(p)
            self.gui_log.set(os.path.join(p, 'log', 'gui'))
            # Look for plots in working directory to display
            self.graph_widgets()

        return result 
Example #19
Source File: OpenTool.py    From Open-Manager with MIT License 5 votes vote down vote up
def ok(self, event=None):
        urlname = self.name.get().strip()
        url = self.url.get().strip()

        if urlname == '' or url == '':
            messagebox.showwarning('警告', '输入不能为空!')
            return

        # if self.parent.urllist.has_key(self.parent.name): # has_key() 方法
        if urlname in self.parent.urllist:
            if messagebox.askyesno('提示', '名称 ‘%s’ 已存在,将会覆盖,是否继续?' % urlname):
                pass
            else:
                return

        # 顯式地更改父窗口參數
        # self.parent.name = urlname
        # self.parent.url = url

        self.parent.urllist[urlname] = url

        # 重新加载列表
        self.parent.listbox.delete(0, END)
        for item in self.parent.urllist:
            self.parent.listbox.insert(END, item)
        self.destroy()  # 銷燬窗口 
Example #20
Source File: gui.py    From snn_toolbox with MIT License 5 votes vote down vote up
def check_file(self, p):
        """Check files."""
        if not os.path.exists(self.settings['path_wd'].get()) or \
                not any(p in fname for fname in
                        os.listdir(self.settings['path_wd'].get())):
            msg = ("Failed to set filename base:\n"
                   "Either working directory does not exist or contains no "
                   "files with base name \n '{}'".format(p))
            messagebox.showwarning(title="Warning", message=msg)
            return False
        else:
            return True 
Example #21
Source File: payugui.py    From SpamSms with MIT License 5 votes vote down vote up
def spam(self):
		T=True
		try:
			if self.no.get() == '':
				messagebox.showwarning('Masukan Nomor','Kalo ngak ada tujuannya pesannya mau dikirim kemana bosqu?')
				T=False
			elif len(self.msg.get()) > 150:
				messagebox.showwarning('Pesan Error','Pesan maksimal 150 karakter')
				T=False
			o=[]
			bs=BS(self.br.open(self.u),features="html.parser")
			for x in bs.find_all("span"):
				o.append(x.text)
			capt=int(o[0].split(' ')[0])+int(o[0].split(' ')[2])
			self.br.select_form(nr=0)
			self.br.form['nohp']=self.no.get()
			self.br.form['pesan']=self.msg.get()
			self.br.form['captcha']=str(capt)
			if T == True:
				sub=self.br.submit().read()
				#print(sub)
				if 'SMS Gratis Telah Dikirim' in str(sub):
					stat=f"[+] Terkirim ke {self.no.get()}\n"
				elif 'Mohon Tunggu' in str(sub):
					stat="[!] Tunggu beberapa saat untuk mengirim sms yang sama\n"
				else:
					stat=f"[-] Gagal Terkirim ke {self.no.get()}\n"
				Tex.insert(END, stat)
		except:
			messagebox.showerror('Error','Sepertinya ada yang salah. coba:\nPriksa koneksi internet anda atau\nLaporkan ke author') 
Example #22
Source File: wallet_app.py    From cryptocurrency-samplecode with Apache License 2.0 5 votes vote down vote up
def get_message_callback(self, target_message):
        print('get_message_callback called!')
        if target_message['message_type'] == 'cipher_message':
            try:
                encrypted_key = base64.b64decode(binascii.unhexlify(target_message['enc_key']))
                print('encripted_key : ', encrypted_key)
                decrypted_key = self.km.decrypt_with_private_key(encrypted_key)
                print('decrypted_key : ', binascii.hexlify(decrypted_key).decode('ascii'))
                # 流石に名前解決をしないで公開鍵のまま出しても意味なさそうなのでコメントアウト
                #sender = binascii.unhexlify(target_message['sender'])
                aes_util = AESUtil()
                decrypted_message = aes_util.decrypt_with_key(base64.b64decode(binascii.unhexlify(target_message['body'])), decrypted_key)
                print(decrypted_message.decode('utf-8'))
                """
                message = {
                    'from' : sender,
                    'message' : decrypted_message.decode('utf-8')
                }
                message_4_display = pprint.pformat(message, indent=2)
                """
                messagebox.showwarning('You received an instant encrypted message !', decrypted_message.decode('utf-8'))
            except Exception as e:
                print(e, 'error occurred')
        elif target_message['message_type'] == 'engraved':
            sender_name = target_message['sender_alt_name']
            msg_body = base64.b64decode(binascii.unhexlify(target_message['message'])).decode('utf-8')
            timestamp = datetime.datetime.fromtimestamp(int(target_message['timestamp']))
            messagebox.showwarning('You received a new engraved message!', '{} :\n {} \n {}'.format(sender_name, msg_body, timestamp)) 
Example #23
Source File: simpledialog.py    From ironpython3 with Apache License 2.0 5 votes vote down vote up
def validate(self):
        try:
            result = self.getresult()
        except ValueError:
            messagebox.showwarning(
                "Illegal value",
                self.errormessage + "\nPlease try again",
                parent = self
            )
            return 0

        if self.minvalue is not None and result < self.minvalue:
            messagebox.showwarning(
                "Too small",
                "The allowed minimum value is %s. "
                "Please try again." % self.minvalue,
                parent = self
            )
            return 0

        if self.maxvalue is not None and result > self.maxvalue:
            messagebox.showwarning(
                "Too large",
                "The allowed maximum value is %s. "
                "Please try again." % self.maxvalue,
                parent = self
            )
            return 0

        self.result = result

        return 1 
Example #24
Source File: GUI_message_box_yes_no_cancel.py    From Python-GUI-Programming-Cookbook-Third-Edition with MIT License 5 votes vote down vote up
def _msgBox():
#     msg.showinfo('Python Message Info Box', 'A Python GUI created using tkinter:\nThe year is 2019.')  
#     msg.showwarning('Python Message Warning Box', 'A Python GUI created using tkinter:\nWarning: There might be a bug in this code.')
#     msg.showerror('Python Message Error Box', 'A Python GUI created using tkinter:\nError: Houston ~ we DO have a serious PROBLEM!')
    answer = msg.askyesnocancel("Python Message Multi Choice Box", "Are you sure you really wish to do this?")
    print(answer)
            
# Add another Menu to the Menu Bar and an item 
Example #25
Source File: GUI_message_box_error.py    From Python-GUI-Programming-Cookbook-Third-Edition with MIT License 5 votes vote down vote up
def _msgBox():
#     msg.showinfo('Python Message Info Box', 'A Python GUI created using tkinter:\nThe year is 2019.')  
#     msg.showwarning('Python Message Warning Box', 'A Python GUI created using tkinter:'
#                       '\nWarning: There might be a bug in this code.')
    msg.showerror('Python Message Error Box', 'A Python GUI created using tkinter:'
                  '\nError: Houston ~ we DO have a serious PROBLEM!')
        
# Add another Menu to the Menu Bar and an item 
Example #26
Source File: GUI_message_box_warning.py    From Python-GUI-Programming-Cookbook-Third-Edition with MIT License 5 votes vote down vote up
def _msgBox():
#     msg.showinfo('Python Message Info Box', 'A Python GUI created using tkinter:'
#                   '\nThe year is 2019.')  
    msg.showwarning('Python Message Warning Box', 'A Python GUI created using tkinter:'
                    '\nWarning: There might be a bug in this code.')
    
# Add another Menu to the Menu Bar and an item 
Example #27
Source File: tkconch.py    From learn_python3_spider with MIT License 5 votes vote down vote up
def clientConnectionFailed(self, connector, reason):
        tkMessageBox.showwarning('TkConch','Connection Failed, Reason:\n %s: %s' % (reason.type, reason.value)) 
Example #28
Source File: simpledialog.py    From Fluid-Designer with GNU General Public License v3.0 5 votes vote down vote up
def validate(self):
        try:
            result = self.getresult()
        except ValueError:
            messagebox.showwarning(
                "Illegal value",
                self.errormessage + "\nPlease try again",
                parent = self
            )
            return 0

        if self.minvalue is not None and result < self.minvalue:
            messagebox.showwarning(
                "Too small",
                "The allowed minimum value is %s. "
                "Please try again." % self.minvalue,
                parent = self
            )
            return 0

        if self.maxvalue is not None and result > self.maxvalue:
            messagebox.showwarning(
                "Too large",
                "The allowed maximum value is %s. "
                "Please try again." % self.maxvalue,
                parent = self
            )
            return 0

        self.result = result

        return 1 
Example #29
Source File: wicc_view_popup.py    From WiCC with GNU General Public License v3.0 5 votes vote down vote up
def warning(subject, text):
        messagebox.showwarning(subject, text) 
Example #30
Source File: root.py    From nordpy with GNU General Public License v3.0 5 votes vote down vote up
def wrong_root_password():
    """
    Shows a window dialog notifying that the root password is not correct
    :return:
    """
    messagebox.showwarning(title="Wrong password", message="Wrong root password, insert it again")