コード例 #1
0
    def starte(self):
        """ Start-Methode, die vom Start-Button aufgerufen wird. 
            
            Dabei wird eine neue Spielsituation mithilfe der Klasse SpielErzeugen erstellt. 
        """

        # boolescher Wert zum Überprüfen, ob das Eingabefenster vom Benutzer richtig bedient wurde
        korrekte_eingabe = True

        # Der bei der Combobox ausgewählte Schwierigkeitsgrad wird ermittelt.
        ausgewählter_grad = self.auswahl_liste_schwierigkeitsgrad.get()

        if ausgewählter_grad != "":
            schwierigkeitsgrad = self.schwierigkeitsgrade[ausgewählter_grad]

        else:
            messagebox.showwarning("Fehler!", "Schwierigkeitsgrad angeben!")
            korrekte_eingabe = False

        # Ebenfalls wird die ausgewählte Größe abgerufen.
        ausgewählte_größe = self.auswahl_liste_größe_spielfeld.get()

        if ausgewählte_größe != "":
            größe_spielfeld = self.größen_spielfeld[ausgewählte_größe]

        else:
            messagebox.showwarning("Fehler!",
                                   "Größe des Spielfelds auswählen!")
            korrekte_eingabe = False

        # Falls eine korrekte Eingabe erfolgte, kann nun eine Spielsituation mit den ausgewählten Parametern erstellt werden.
        if korrekte_eingabe:
            # Klasse SpielErzeugen wird aufgerufen
            self.spiel = SpielErzeugen(schwierigkeitsgrad, größe_spielfeld)
コード例 #2
0
def botao_verficar_troco_click():
    total_compra = float(produto_preco.get()) * float(produto_qtde.get())
    troco = float(valor_recebido.get())-float(total_compra)
    if float(valor_recebido.get()) > total_compra:
       label_Fim["text"] = " Obrigado! Seu troco é: " + str(troco)
    elif float(valor_recebido.get()) < total_compra:
        messagebox.showwarning("Atenção","Valor recebido é menor do que o Total da Compra, Socilite o restante: "+ str(troco*-1))
    else:
       label_Fim["text"] = " Obrigado! Volte Sempre!" 
コード例 #3
0
    def noimage(self):
        if pyver == 2:
            import tkMessageBox

            tkMessageBox.showwarning("No Image Export", "Image exporting not available! Use screenshots for now!")
        elif pyver == 3:
            from Tkinter import messagebox

            messagebox.showwarning("No Image Export", "Image exporting not available! Use screenshots for now!")
コード例 #4
0
def button_process(root):
    #create message box
    messagebox.askokcancel('Python Tkinter',
                           'Are you sure to create a window?')
    messagebox.askquestion('Python Tkinter',
                           "Are you sure to create a window?")
    messagebox.askyesno('Python Tkinter', 'Are you sure to create a window?')
    messagebox.showerror('Python Tkinter', 'Unknown Error')
    messagebox.showinfo('Python Tkinter', 'hello world')
    messagebox.showwarning('Python Tkinter', 'Leave now')
    root1 = Toplevel(root)
コード例 #5
0
ファイル: gui.py プロジェクト: dev4love/Weather
    def _searchCity(self):
        self.info.delete(u'1.0', tk.END)

        _cityName = self.cityName.get()
        if len(_cityName) == 0:
            messagebox.showwarning(u'Please input a city name',
                                   u'Please input a city name for search.')
            return

        cities = self.api.queryCityInfo(_cityName)
        # print(cities)
        if len(cities) == 0:
            messagebox.showerror(u'没有查询到城市', u'没有查询到城市,请检查输入!')
            return
        elif len(cities) == 1:
            self._showWeather(cities[0])

        else:
            self._askForSelect(cities)
コード例 #6
0
ファイル: db_update.py プロジェクト: x1234xx/nekros
 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!"
             )
コード例 #7
0
 def match(self):
     global name_1, name_2
     if len(self.get_name1.get()) != 3:
         messagebox.showwarning("< 이름 입력 오류 >", "3자 이름을 입력해주세요.")
     else:
         if len(self.get_name2.get()) != 3:
             messagebox.showwarning("< 이름 입력 오류 >", "3자 이름을 입력해주세요.")
         else:
             name_1 = self.get_name1.get()
             name_2 = self.get_name2.get()
             for i in range(3):
                 if ord(name_1[i]) < 44032 or ord(name_1[i]) > 55203:
                     messagebox.showwarning("< 이름 입력 오류 >", "한글로만 입력해주세요.")
                     return None
                 elif ord(name_2[i]) < 44032 or ord(name_2[i]) > 55203:
                     messagebox.showwarning("< 이름 입력 오류 >", "한글로만 입력해주세요.")
                     return None
             show_zone.showLoveSum()
             self.match_btn.destroy()
コード例 #8
0
def check_password():
    score = 0
    check_button.config(
        state='disabled'
    )  #to avoid spamming of msgboxes (yes im talking to you)
    contents = checker_field.get()
    password_integrity = verify_password(contents)
    length = len(contents)
    global length_msg

    if length > 100:  #extra cool kid stuff (:cool:)
        length_msg = "Wow! " + str(
            length) + " characters! Don't you think that's a bit overboard?"

    elif length < 1:
        messagebox.showwarning(
            "Password Issue",
            "You didn't input anything! It can't work without input")
        check_button.config(state='normal')
        return 0

    else:
        length_msg = "You use a total of " + str(length) + " characters!"

    if password_integrity == "too short":
        messagebox.showwarning(
            "Password Issue", "Password entered is too short! (minimum = 10) ")

    elif password_integrity == "no lowercase":
        messagebox.showwarning(
            "Password Issue",
            "Password does not have any lowercase characters!")

    elif password_integrity == "no uppercase":
        messagebox.showwarning(
            "Password Issue",
            "Password does not have any uppercase characters!")

    elif password_integrity == "no specials":
        messagebox.showwarning(
            "Password Issue",
            "Password does not have any special characters! (ex: !$@)")

    elif password_integrity == "no numbers":
        messagebox.showwarning("Password Issue", "No numbers in password!")

    elif password_integrity == "whitespace character":
        messagebox.showwarning(
            "Password Issue",
            "Whitespace character detected! Do not use spaces in your password!"
        )

    elif password_integrity == "valid":
        messagebox.showinfo(
            "Password Valid!",
            "Nice job! Password entered is valid! " + length_msg)

    else:
        messagebox.showerror(
            "Error!",
            "No clue what you have done, however it's caused an error with the checking system! Verify your password you damn hacker"
        )

    check_button.config(state='normal')
コード例 #9
0
 def showWarningBox(self):
     messagebox.showwarning("Invalid Move", "Beware")