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: 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 #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: 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 #5
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 #6
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 #7
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 #8
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 #9
Source File: tk.py    From Jtyoui with MIT License 5 votes vote down vote up
def start():
    global DIRS, FILE
    if DIRS:
        image_pdf(DIRS)  # 执行图片转pdf
        DIRS = ''
    elif FILE:
        if not os.path.exists(FILE[:-4]):
            os.mkdir(FILE[:-4])
        pdf_image(FILE)  # 执行pdf转照片
        FILE = ''
    else:
        messagebox.showwarning('警告', '先选择在执行!') 
Example #10
Source File: decrypt.py    From RAASNet with GNU General Public License v3.0 5 votes vote down vote up
def dec_key():
    key = password(text='Please enter your decryption key', title='Enter Key', mask ='*')
    if key == None or key == '':
        messagebox.showwarning('Error', 'No key given. Canceled...')
        return False
    return key 
Example #11
Source File: decrypt.py    From RAASNet with GNU General Public License v3.0 5 votes vote down vote up
def dec_path():
    path = askdirectory(title = 'Select directory with files to decrypt')
    if path == None or path == '':
        messagebox.showwarning('Error', 'No path selected, exiting...')
        return False
    path =  path + '/'
    return path 
Example #12
Source File: RAASNet.py    From RAASNet with GNU General Public License v3.0 5 votes vote down vote up
def dec_key():
    key = password(text='Please enter your decryption key', title='Enter Key', mask ='*')
    if key == None or key == '':
        messagebox.showwarning('Error', 'No key given. Canceled...')
        return False
    return key 
Example #13
Source File: RAASNet.py    From RAASNet with GNU General Public License v3.0 5 votes vote down vote up
def dec_path():
    path = askdirectory(title = 'Select directory with files to decrypt')
    if path == None or path == '':
        messagebox.showwarning('Error', 'No path selected, exiting...')
        return False
    path =  path + '/'
    return path 
Example #14
Source File: RAASNet.py    From RAASNet with GNU General Public License v3.0 5 votes vote down vote up
def login(self):
        # Check username and password
        check_pwd = hashlib.sha256(self.options['pwd'].get().encode('utf-8')).hexdigest()

        payload = {'user': self.options['username'].get(), 'pwd': check_pwd}

        r = requests.post('https://zeznzo.nl/login.py', data=payload)
        if r.status_code == 200:
            if r.text.startswith('[ERROR]'):
                messagebox.showwarning('ERROR', r.text.split('[ERROR] ')[1])
                return
            elif r.text.startswith('[OK]'):
                data = r.text[13:]
                data = data.split('\n')
                prof = {}

                try:
                    for i in data:
                        i = i.split('=')
                        prof[i[0]] = i[1]
                except Exception:
                    pass

                self.destroy()
                main = MainWindow(self.options['username'].get(), self.options['pwd'].get(), prof['Email'], prof['Name'], prof['Surname'], prof['Rank'], prof['Status'])
                main.mainloop()
        else:
            messagebox.showwarning('ERROR', 'Failed to contact login server!\n%i' % r.status_code)
            return 
Example #15
Source File: RAASNet.py    From RAASNet with GNU General Public License v3.0 5 votes vote down vote up
def open_server(self):
        self.set = Toplevel()
        self.set.title(string = 'Settings')
        self.set.configure(background = 'white')
        self.set.resizable(0,0)

        Label(self.set, text = 'Host', background = 'white').grid(row = 1, column = 0, sticky = 'w')
        host = Entry(self.set, textvariable = self.options['host'], width = 30)
        host.grid(row = 2, column = 0, columnspan = 2)
        host.focus()

        Label(self.set, text = 'port', background = 'white').grid(row = 3, column = 0, sticky = 'w')
        port = Entry(self.set, textvariable = self.options['port'], width = 30)
        port.grid(row = 4, column = 0, columnspan = 2)

        #Checkbutton(self.set, text = "Save keys to Onion Portal account", variable = self.options['save_keys'], onvalue = 1, offvalue = 0).grid(row = 5, column = 0, columnspan = 2, sticky = 'w')

        if host == None or host == '':
            messagebox.showwarning('ERROR', 'Invalid host!')
        elif port == None or port == '':
            messagebox.showwarning('ERROR', 'Invalid port!')
        else:
            self.options['host'] == host
            self.options['port'] == port

        go = Button(self.set, text = 'Ok', command = self.run_server, width = 30)
        go.grid(row = 7, column = 0, columnspan = 2)
        self.set.bind('<Return>', self.set.destroy)
        exit = Button(self.set, text = 'Cancel', command = self.set.destroy, width = 30).grid(row = 8, column = 0, columnspan = 2) 
Example #16
Source File: RAASNet.py    From RAASNet with GNU General Public License v3.0 5 votes vote down vote up
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 #17
Source File: RAASNet.py    From RAASNet with GNU General Public License v3.0 5 votes vote down vote up
def make_demon(self):

        try:
            create_demon(self.options['host'].get(),
                self.options['port'].get(),
                self.options['full_screen_var'].get(),
                self.options['demo'].get(),
                self.options['type'].get(),
                self.options['method'].get(),
                self.options['msg'].get(),
                self.options['img_base64'].get(),
                self.options['mode'].get(),
                self.options['debug'].get(),
                self.options['target_ext'].get(),
                self.options['target_dirs'].get(),
                self.options['remove_payload'].get(),
                self.options['working_dir'].get(),
                self.options['runas'].get())
        except Exception as e:
            messagebox.showwarning('ERROR', 'Failed to generate payload!\n\n%s' % e)
            return
        try:
            create_decrypt(self.options['type'].get())

            messagebox.showinfo('SUCCESS', 'Payload and decryptor were successfully generated!\n\nFiles saved to:\n./payload.py\n./decryptor.py')
        except Exception as e:
            messagebox.showwarning('ERROR', 'Failed to generate decryptor!\n\n%s' % e)

        self.gen.destroy() 
Example #18
Source File: RAASNet.py    From RAASNet with GNU General Public License v3.0 5 votes vote down vote up
def activate(self):
        key = password(text='Please enter your activation key', title='Enter Key')
        if key == None:
            messagebox.showwarning('Error', 'No key given. Canceled...')
            return

        self.check_activation(key) 
Example #19
Source File: RAASNet.py    From RAASNet with GNU General Public License v3.0 5 votes vote down vote up
def decline_license(self):
        messagebox.showwarning('DECLINED', 'You rejected the license.\n\nYou are not allowed to use this software.\n\nRelaunch it and click "agree" if you changed your mind.\n\nThis program will now exit... Goodbye!')
        sys.exit(0) 
Example #20
Source File: barcode-generator-macos.py    From Barcode-generator with GNU General Public License v3.0 5 votes vote down vote up
def saveasfile(self, event=None):
        if self.bcode_val.get():
            if event:
                self.savebarcode(self.bcode_val.get())
            else:
                self.savebarcode(self.bcode_val.get(), True)
            self.updatetree()
        else:
            mbox.showwarning("Warning", "Generate any barcode first!") 
Example #21
Source File: barcode-generator-macos.py    From Barcode-generator with GNU General Public License v3.0 5 votes vote down vote up
def already_exist(self, warn=True, bcode=None):
        if warn:
            mbox.showwarning("Warning", "Barcode is already in table!")
            return False
        else:
            if not self.isunique(bcode):
                self.updatecomment(self.existcomment) 
Example #22
Source File: barcode-generator-Windows.py    From Barcode-generator with GNU General Public License v3.0 5 votes vote down vote up
def saveasfile(self, event=None):
        if self.bcode_val.get():
            if event:
                self.savebarcode(self.bcode_val.get())
            else:
                self.savebarcode(self.bcode_val.get(), True)
            self.updatetree()
        else:
            mbox.showwarning("Warning", "Generate any barcode first!"); 
Example #23
Source File: barcode-generator-Windows.py    From Barcode-generator with GNU General Public License v3.0 5 votes vote down vote up
def already_exist(self, warn=True, bcode=None):
        if warn:
            mbox.showwarning("Warning", "Barcode is already in table!");
            return False
        else:
            if not self.isunique(bcode):
                self.updatecomment(self.existcomment) 
Example #24
Source File: barcode-generator-Linux.py    From Barcode-generator with GNU General Public License v3.0 5 votes vote down vote up
def saveasfile(self, event=None):
        if self.bcode_val.get():
            if event:
                self.savebarcode(self.bcode_val.get())
            else:
                self.savebarcode(self.bcode_val.get(), True)
            self.updatetree()
        else:
            mbox.showwarning("Warning", "Generate any barcode first!"); 
Example #25
Source File: barcode-generator-Linux.py    From Barcode-generator with GNU General Public License v3.0 5 votes vote down vote up
def already_exist(self, warn=True, bcode=None):
        if warn:
            mbox.showwarning("Warning", "Barcode is already in table!");
            return False
        else:
            if not self.isunique(bcode):
                self.updatecomment(self.existcomment) 
Example #26
Source File: mainmenu.py    From Python-GUI-Programming-with-Tkinter with MIT License 5 votes vote down vote up
def on_theme_change(self, *args):
        """Popup a message about theme changes"""
        message = "Change requires restart"
        detail = (
            "Theme changes do not take effect"
            " until application restart")
        messagebox.showwarning(
            title='Warning',
            message=message,
            detail=detail) 
Example #27
Source File: mainmenu.py    From Python-GUI-Programming-with-Tkinter with MIT License 5 votes vote down vote up
def on_theme_change(self, *args):
        """Popup a message about theme changes"""
        message = "Change requires restart"
        detail = (
            "Theme changes do not take effect"
            " until application restart")
        messagebox.showwarning(
            title='Warning',
            message=message,
            detail=detail) 
Example #28
Source File: application.py    From Python-GUI-Programming-with-Tkinter with MIT License 5 votes vote down vote up
def upload_to_corporate_rest(self):

        csvfile = self._create_csv_extract()

        if csvfile is None:
            messagebox.showwarning(
                title='No records',
                message='There are no records to upload'
            )
            return

        d = v.LoginDialog(
            self,
            'Login to ABQ Corporate REST API'
        )
        if d.result is not None:
            username, password = d.result
        else:
            return
        try:
            n.upload_to_corporate_rest(
                csvfile,
                self.settings['abq_upload_url'].get(),
                self.settings['abq_auth_url'].get(),
                username,
                password)
        except n.requests.RequestException as e:
            messagebox.showerror('Error with your request', str(e))
        except n.requests.ConnectionError as e:
            messagebox.showerror('Error connecting', str(e))
        except Exception as e:
            messagebox.showerror('General Exception', str(e))
        else:
            messagebox.showinfo(
                'Success',
                '{} successfully uploaded to REST API.'.format(csvfile)
            ) 
Example #29
Source File: views.py    From Python-GUI-Programming-with-Tkinter with MIT License 5 votes vote down vote up
def on_theme_change(self, *args):
        """Popup a message about theme changes"""
        message = "Change requires restart"
        detail = (
            "Theme changes do not take effect"
            " until application restart")
        messagebox.showwarning(
            title='Warning',
            message=message,
            detail=detail) 
Example #30
Source File: mainmenu.py    From Python-GUI-Programming-with-Tkinter with MIT License 5 votes vote down vote up
def on_theme_change(self, *args):
        """Popup a message about theme changes"""
        message = "Change requires restart"
        detail = (
            "Theme changes do not take effect"
            " until application restart")
        messagebox.showwarning(
            title='Warning',
            message=message,
            detail=detail)