コード例 #1
0
ファイル: room23.py プロジェクト: Forritarar-FS/Kastali
def bob():
	#add green door
	ll = messagebox.askquestion("Mr.Bones","Would you like to wander about aimlessly?")
	if ll == "yes":
		messagebox.showerror("Mr.Bones","You stumbled upon a trap by falling into it.")
		exec("GAME OVER")
	lk = messagebox.askquestion("Mr.Bones","You see something in the distance. want to check it out?")
	if lk == "yes":
		messagebox.showerror("Mr.Bones","You see a green door. it needs a key of some kind.")
		if "A F**k to give" in room.grunnur.items:
			messagebox.showerror("Mr.Bones","The given f**k Can open this door.")
			messagebox.showerror("Mr.Bones","You found a red cane!")
	messagebox.showerror("Mr.Bones","after twists and turns you see a straight path.")

	bg = messagebox.askquestion("Mr.Bones","Will you turn right?")
	if bg == "yes":
		dod()
	else:
		messagebox.showerror("Mr.Bones","You DARE take a left?!?")
	hg = messagebox.askquestion("Mr.Bones","A scary scary scarecrow stands before you. Will you dare to poke it?")
	if hg == "no":
		messagebox.showerror("Mr.Bones","You walk forward and the walls close on you. Killing you instantly.")
		exec("GAME OVER")
	messagebox.showerror("Mr.Bones","The scarecrow screaches unholy screams of terror that send chills down your spine.")
	ki=messagebox.askquestion("Mr.Bones","Will you shit your pants?")
	if ki == "no":
		messagebox.showerror("Mr.Bones","You shat them anyway.")
	bananaleave = room.grunnur(23)
	bananaleave.go("s")
コード例 #2
0
ファイル: gui.py プロジェクト: StoianCatalin/DirSync
 def askUserBeforeDelete(self):
     "This function is for dialog to ask user if he is sure."
     messagebox.askquestion("Warning!", "This action will remove all files from destination folder. Are you sure?", icon="warning")
     if 'yes':
         self.syncronFolder()
     else:
         return 0
コード例 #3
0
 def checkNotes(self):
     if len(self.notes.get(1.0, "end")) > 1:
         self.submit()
     else:
         mb.askquestion(
             title="Whoops!", message="You haven't entered any notes. Would you like to submit your job journal anyway?")
         return False
コード例 #4
0
ファイル: Point_of_Sale.py プロジェクト: duangchitangela/PoS
def b4exit():
    global print_date
    global print_time
    print_date = DATE()
    print_time = TIME()
    date_time = print_date + " - " + print_time
    if(init_ready4newTrans == True):
        quitORnot = messagebox.askquestion("Continue", "Exit program?", icon='warning')
        if quitORnot == 'yes':
            print("/////// Program is terminated //////////")
            file = open(output_txt, 'a+')
            file.write("\n///////////////////////// Program is terminated (" + date_time + ") /////////////////////////\n")
            file.close()
            root.destroy()
            root.quit()
        else:
            continue_trans()
    else:
        quitORnot = messagebox.askquestion("Continue", "Exit program?\n...Current transaction will be removed", icon='warning')
        if quitORnot == 'yes':
            print("/////// Program is terminated //////////")
            file = open(output_txt, 'a+')
            file.write("\n=============== The transaction is canceled ===============\n")
            file.write("\n///////////////////////// Program is terminated (" + date_time + ") /////////////////////////\n")
            file.close()
            root.destroy()
            root.quit()
        else:
            continue_trans()
コード例 #5
0
ファイル: python3_2048.py プロジェクト: penglee87/lpython
    def bind_key(self, event):
        '''
        key event
        '''
        if model.is_over(self.matrix):
            if askquestion("GAME OVER","GAME OVER!\nDo you want to init it?") == 'yes':
                self.matrix = my_init()
                self.btn_show_matrix(self.matrix)
                return
            else:
                self.root.destroy()
        else:
            if event.keysym.lower() == "q":
                self.root.destroy()
            elif event.keysym == "Left":
                self.matrix = model.move_left(self.matrix)
            elif event.keysym == "Right":
                self.matrix = model.move_right(self.matrix)
            elif event.keysym == "Up":
                self.matrix = model.move_up(self.matrix)
            elif event.keysym == "Down":
                self.matrix = model.move_down(self.matrix)
            elif event.keysym.lower() == "b":
                if len(matrix_stack) == 1:
                    showinfo('info', 'Cannot back anymore...')
                else:
                    matrix_stack_forward.append(self.matrix)
                    matrix_stack.pop()
                    self.matrix = matrix_stack[-1]
            elif event.keysym.lower() == "f":
                if len(matrix_stack_forward) == 0:
                    showinfo('info', 'Cannot forward anymore...')
                else:
                    self.matrix = matrix_stack_forward[-1]
                    matrix_stack_forward.pop()
                    matrix_stack.append(self.matrix)
                       
            if event.keysym in ["q", "Left", "Right", "Up", "Down"]:
                try:
                    self.matrix = model.insert(self.matrix)
                    matrix_stack.append(self.matrix)
                    del matrix_stack_forward[0:]
                except:
                    pass
            try:
                self.btn_show_matrix(self.matrix)
            except:
                pass

        if model.is_win(self.matrix):
            if askquestion("WIN","You win the game!\nDo you want to init it?") == 'yes':
                self.matrix = my_init()
                self.btn_show_matrix(self.matrix)
                return
            else:
                self.root.destroy()
コード例 #6
0
ファイル: json_editor.py プロジェクト: quimbp/cosmo
 def close(self):
 # ---------------------
   if self.exit_mode == 'quit':
     ''' Closing the main widget '''
     messagebox.askquestion('Close','Are you sure?',icon='warning')
     if 'yes':
       quit()
   else:
     self.master.destroy()
     return
コード例 #7
0
ファイル: main.py プロジェクト: zdw27f/Projects
def checkSave():
    global currentFile

    # Asks the user if they want to save; question changes depending on if the
    # user has a new file or existing file open.
    if currentFile:
        choice = askquestion('Text Editor', 'Do you want to save changes to ' +
                             currentFile + '?')
    else:
        choice = askquestion('Text Editor', 'Do you want to save changes to' +
                             ' Untitled?')
    return choice
コード例 #8
0
ファイル: room23.py プロジェクト: Forritarar-FS/Kastali
def dod():
	#leads to billy,bobby,asdf
	#dead end
	messagebox.showerror("Mr.Bones","Not all correct ways are to the right.")
	kb = messagebox.askquestion("Mr.Bones","would you like to proceed?")
	if kb == "yes":
		messagebox.showerror("Mr.Bones","You tripped and died.")
		exec("GAME OVER")
	messagebox.showerror("Mr.Bones","Or...wait here.")
	messagebox.showerror("Mr.Bones","You walk forward regardless of your will")
	ko = messagebox.askquestion("Mr.Bones","You see a fork in the road. turn right?")
	if ko == "no":
		messagebox.showerror("Mr.Bones","You suddenly explode without reason.")
		exec("GAME OVER")
	kp = messagebox.askquestion("Mr.Bones","Strange. There is another fork in the rode you just chose...left?")
	if kp =="yes":
			billy()
	ja = messagebox.askquestion("Mr.Bones","Yet another fork. Go right?")
	if ja == "yes":
		messagebox.showinfo("Mr.Bones","You step on a landmine.")
		exec("GAME OVER BITCH!")
	hf= messagebox.askquestion("Mr.Bones","these 'forks' seem to go on endlessly. Left? Yes? No?")
	if hf =="yes":
			bobby()
	ge=messagebox.askquestion("Mr.Bones","Right?")
	if ge=="yes":
		asdf()
	gh=messagebox.askquestion("Mr.Bones","right again?")
	if gh =="yes":
	 	messagebox.showerror("Mr.Bones","WRONG!!!")
	 	exec("GAME OVER")
	gq=messagebox.askquestion("Mr.Bones","Left?")
	if gq=="yes":
	 	messagebox.showerror("Mr.Bones","You step forward not knowing that the roof just caved in on you.")
	 	exec("GAME OVER")
	messagebox.showerror("Mr.Bones","You turn and turn, after thoushands of left and rights you see a sign.")
	gf=messagebox.askquestion("Mr.Bones","Want to read it?")
	if gf=="yes":
	 	gj= messagebox.askquestion("Mr.Bones","It is a sign for the blind. Want to try reading it anyway?")
	 	if gj=="yes":
	 		messagebox.showinfo("Mr.Bones","It says 'Dead end bitch!'")
	 	else:
	 		messagebox.showerror("Mr.Bones","You choke on the sign.")
	else:
		messagebox.showinfo("Mr.Bones","you sit still. You sit still for a looooooong time.")
		messagebox.showinfo("Mr.Bones","Yup....waiting.")
		i = 0
		while i != 20:
			messagebox.showinfo("Mr.Bones","")
			i += 1
 	
		messagebox.showerror("Mr.Bones","You suddenly starve. I wonder why")
		exec("GAME OVER")
コード例 #9
0
ファイル: room13.py プロジェクト: Forritarar-FS/Kastali
	def DaStar():
		if mechanic == "open":
			golden = messagebox.askquestion( 'k', 'Það er stytta og kött úr skýra gulli, viltu taka hana?')
			if golden == 'yes':
				room.grunnur.items.append('Gullni Kötturinn')
			else:
				background_label.grid(row=2, column=2)
				B.grid(row=1, column=1)
				G.grid(row=1, column=2)
				C.grid(row=1, column=3)
		else:
			messagebox.askquestion( 'k', 'Þú þarft að opna fyrir lásinn í herbergi styrks')
			top = tkinter.Tk()
		pass
コード例 #10
0
ファイル: menu.py プロジェクト: mjec/ultimatexo
 def exit(self, e=None):
     confirm = messagebox.askquestion(
         "Quit",
         "Are you sure you want to quit?",
         icon="warning")
     if "yes" == confirm:
         exit(0)
コード例 #11
0
ファイル: GUI.py プロジェクト: carefree0910/SimpleDictionary
 def close_gui(self):
     result = tkm.askquestion("made by carefree0910", "Backup?")
     if result == "yes":
         with open(self.path + "backup.dat", "wb") as file:
             with open(self.path + "dic.dat", "rb") as f:
                 pickle.dump(pickle.load(f), file)
     self.master.destroy()
コード例 #12
0
ファイル: CustomThreads.py プロジェクト: mathbum/PeerToPeer
	def silentExchangeQuestion(self, sock, addressIP, ID):
		result = messagebox.askquestion("New Connection request","Would you like to connect to: " + ID + " at IP address: " + addressIP)
		if result=="yes":
			self.silentExchange(sock, addressIP)
		else:
			sock.send(Utils.FAILED_VERIFY_HEADER)
			sock.close()
コード例 #13
0
ファイル: Vaisseaux.py プロジェクト: djerbiano12/python
 def ouvrirDialogue2(self):
     if messagebox.askquestion("Joueur 2", "Voulez vous placez les vaisseausx aléatoirement?")=="no":
         showinfo("Joueur 2", "Placez votre vaisseau en cliquant sur 5 cases de votre grille !!")
         self.placer_vaisseaux2()
     else:
         self.placerVaisseauAleatoire2()
             
コード例 #14
0
def save_char():
	'''Writes character info to a .txt. file, saved by character name.'''
	def save_to_file(file):
		file.write(my_first_character.name + '\n')
		file.write(str(my_first_character.level) + '\n')
		file.write(my_first_character.race.print_race() + '\n')
		file.write(str(my_first_character.strength) + '\n')
		file.write(str(my_first_character.dexterity) + '\n')
		file.write(str(my_first_character.constitution) + '\n')
		file.write(str(my_first_character.intelligence) + '\n')
		file.write(str(my_first_character.wisdom) + '\n') 
		file.write(str(my_first_character.spent_stat_points)) # no more lines needed
	
	cwd = os.getcwd()
	if os.path.exists(cwd + '\\character'):
		pass # no need to create the folder if it exists already, pass on to next step
	else:
		os.makedirs(cwd + '\\character')
		print("Created new directory to store character files")
	if os.path.exists(cwd + '\\character\\' + my_first_character.name + '.txt'):
		overwrite = messagebox.askquestion('Overwrite character?',
							'Character already exists.  Overwrite?')
		if overwrite == 'yes': 
			char_file = open(cwd + '\\character\\' + my_first_character.name + '.txt', 'w+') 
			save_to_file(char_file)
			char_file.close()
		else:
			messagebox.showinfo('Did not save', 
								'Did not save, did not overwrite existing file.')
	else:
		char_file = open(cwd + '\\character\\' + my_first_character.name + '.txt', 'w+')
		save_to_file(char_file)
		char_file.close()
コード例 #15
0
ファイル: client.py プロジェクト: BooblegumGIT/GiveMyTask
 def next(self, event):
     result = messagebox.askquestion("Next", "Вы уверены, что хотите взять новую задачу? \n"
                                             "(Вы получите 1 штрафной балл)",
                                     icon='warning')
     if result == 'no':
         return
     self.request('next')
コード例 #16
0
    def exit_camera(self):
        status = ""
        useranswer = ""
        useranswer = "no"
        cancelquestion = "You are still recording a video.\nDo you wish to stop recording ?"

        #first check to see if camera is currently recording a video
        if self.camera.recording == True:
            # yes it is recording so ask user if they wish to stop recording
            useranswer=messagebox.askquestion("Exit Error!",
                                         cancelquestion)
            if useranswer == "yes" :
                #if user says yes- stop then stop the recording and cleanup for exit
                self.camera.stop_recording()
                self.camera.stop_preview()
                self.camera.close()
                root.destroy()
            else:
                # otherwise user does not wish to stop so ignore stop request
                status += "continuing recording   \n"
                self.results_txt.delete(7.0, END)
                self.results_txt.insert(7.0, status)
        else :
            # camera isn't currently recording a video so cleanup for exit.
            self.camera.stop_preview()
            self.camera.close()
            root.destroy()
コード例 #17
0
ファイル: RealTimeARS.py プロジェクト: gapatino/RealTime-ARS
def editiClickerFile():
    ''' Called from editiClickerInfo. Sets the values for the variables
    iclickerdict (dictionary of iClickerID (keys) and student ID (values)),
    iclickerfile (csv file where the info for iclicker dict was stored as
    second and first column respectively - yes the order in the csv file is
    inverted with respect to the iclickerdict variable), and studentlist (list
    of student IDs in the same order as user enters them, needed in addition to
    iclickerdict because dictionaries are not ordered) using the filebrowser
    and getiClickerData function. It then passes those values to 
    iClickerManager, a common interface for both createiClickerFile and 
    editiClickerFile'''
    # Initialize the variables
    # Get the file with the iClicker information  
    m1=messagebox.showinfo(message='Select CSV file with the iClicker \
    information')  
    counter=0
    while counter==0:
        iclickerfile=filedialog.askopenfilename() #notice all lowercase 
        if iclickerfile=='':
            m2=messagebox.askquestion(message='No file was selected \
            \nDo you want to try again?')
            if m2=='no': return #if no then go back to main menu
        else:
            # If got a filename extract the data            
            try:
                studentlist, iclickerdict=getiClickerData(iclickerfile)
                counter=1
            except:
                m3=messagebox.showinfo(message='There was a problem with the file\
                \nPlease try again')
    print('editiClickerFile')            
    
    
    return
コード例 #18
0
ファイル: mainwindow.py プロジェクト: B-Rich/tkGAME
    def __download_package (self, item_attrs):
        r"""
             tries to download zip archive and install it locally;
        """

        # inits

        _src = item_attrs["src"]

        # got remote zip archive?

        if tools.is_pstr(_src):

            # ask user for downloading zip archive

            _response = MB.askquestion(

                _("Download"),

                _(
                    "Package is missing locally.\n"
                    "Download it from the web?"
                ),

                parent=self,
            )

            # user is OK to download package

            if _response == MB.YES:

                # show download box component

                self._show_download_box()

                # download in temporary file

                return self.mainframe.debbie.download(url=_src)

            else:

                MB.showinfo(

                    _("Info"),

                    _("Package download aborted."),

                    parent=self,
                )

            # end if - MB.response

        else:

            # error

            raise ValueError(

                _("no remote ZIP archive to download")
            )
コード例 #19
0
ファイル: Cuenta.py プロジェクト: jozz68x/PyAgenda
    def eliminar_cuenta(self):
        index = self.lista.curselection()  # devuelve el indice de la seleccion
        seltext = self.lista.get(index)  # optine los datos del indice seleccionado
        self.id_cuenta = seltext  # optenemos solo el codigo

        borrar = messagebox.askquestion(
            parent=self.master, icon="question", title="Confirmacion:", message="Realmente desea Eliminar?"
        )
        if borrar == "yes":
            try:
                con = sqlite3.connect(r"DB\db.s3db")
                cursor = con.cursor()
                sql = "DELETE  FROM CUENTA WHERE TITULO LIKE '" + self.id_cuenta + "'"
                cursor.execute(sql)
                con.commit()

                mensaje = Message(self.master, text="Cuenta eliminada", width=200, bg="#ffffe1", font=("Arial", 10))
                mensaje.place(in_=self.master, relx=1, anchor="e", y=15, x=-5, bordermode="outside")
                mensaje.after(2000, lambda: mensaje.destroy())

                self.lista.delete(0, END)
                self.listar_listbox()
                self.limpiar_entradas()

            except sqlite3.IntegrityError:
                con.rollback()
            except sqlite3.OperationalError:
                con.rollback()
            finally:
                con.close()
        else:
            pass
コード例 #20
0
ファイル: Othello GUI.py プロジェクト: hodycan/othello
 def _on_close(self) -> None:
     """asks if the user wants to quit"""
     text = 'Are you sure you want to exit Othello?'
     answer = messagebox.askquestion('Othello',
                                     message=text)
     if answer == 'yes':
         self._root.quit()
コード例 #21
0
ファイル: hex_main.py プロジェクト: pterodax/dieter
	def exit(self): # beendet aktuelles Spiel
		winner = self.game.winner()
		if winner == 1:
			color = "red"
			if self.game.mode == "inter" or self.game.mode == "ki":
				if self.game.KI1:
					name = str(self.game.KI1)
				else:
					name = "human"
			else:
				name = "human"
		else:
			color = "blue"
			if self.game.mode == "inter" or self.game.mode == "ki":
				if self.game.KI2:
					name = str(self.game.KI2)
				else:
					name = "human"
			else:
				name = "human"
		finishbox = messagebox.askquestion("", "Player " + str(winner) + " (" + color + ", " + name +  ") won! Play again?") # Popup am Ende des Spiels
		if finishbox == "yes": # Neustart
			self.restart()
		elif finishbox == "no": # Beenden
			self.root.destroy()
コード例 #22
0
ファイル: monitor_manager.py プロジェクト: poohzrn/dotfiles
 def getUserConfirmationIfDangerousConfiguration(self):
     result = "yes"
     if all(map(lambda o: o.blanked or not o.active, self.outputs)):
         result = messagebox.askquestion("All blanked or off",
                 "All ouputs are set to be turned off or blanked, continue?",
                 icon="warning")
     return result == "yes"
コード例 #23
0
ファイル: rad_dialog.py プロジェクト: Guest007/NES
 def verify_pending_task (self):
     """
         hook method to be reimplemented in subclass;
         must return True if task is still pending;
         must return False when all is clear;
     """
     # got pending task?
     if self.get_pending_task():
         # get user confirmation
         _response = MB.askquestion(
             _("Please confirm"),
             _(
                 "Some important tasks are still running.\n"
                 "Should I try to cancel them?"
             ),
             parent=self,
         )
         # asked for cancellation?
         if _response == MB.YES:
             # try to cancel dialog
             return self._slot_button_cancel()
         # end if
         # task is still pending
         return True
     # end if
     # no pending task
     return False
コード例 #24
0
ファイル: Vaisseaux.py プロジェクト: djerbiano12/python
 def ouvrirDialogue1(self):
     if messagebox.askquestion("Joueur 1", "Voulez vous placez les vaisseausx aléatoirement?")=="no":
         showinfo("Joueur 1", "Placez votre vaisseau en cliquant sur 5 cases de votre grille !!")
         self.placer_vaisseaux1()
     else:
         self.B.config(state=DISABLED)
         self.placerVaisseauAleatoire()
コード例 #25
0
ファイル: main.py プロジェクト: nerdcorerising/PyEdit
 def newFile(self,event=None):
     if(self.dirty):
         mod = messagebox.askquestion(title="Save?", 
             message="File Modified, Save Before Opening New File?", default="yes")
         if(mod == "yes"):
             self.saveCurrent()
     self.text.clear()
     self.currentfile = None
コード例 #26
0
    def mostra_vencedor_reset(self, resultado):
        self.janela_resultado = tkm.askquestion("Resultado", "{0}\nNovo Jogo?".format(resultado)) #criaçaão da tela pop up
        
        self.meu_jogo.limpa_jogadas()
        self.limpa_tela()

        if self.janela_resultado == "no": #caso o clique seja não, o jogo fecha
            self.window.destroy()
コード例 #27
0
ファイル: graafika.py プロジェクト: crypotex/ttt
 def popup_viik(self):
     sonum2 = "Olete mõlemad tublid. Saavutasite Viigi"
     sonum2 += ".\n" + "Kas tahad mängida uuesti? "
     response = messagebox.askquestion("VIIK!", sonum2)
     if response == "yes":
         self.reload_table()
     else:
         self.master.destroy()
コード例 #28
0
ファイル: 123.py プロジェクト: SemikO123/YODA
 def razgovor():
     otvet = box.askquestion('mazafaka?','отвечай, бич!')
     if otvet == 'yes' :
         box.showinfo('ублюдок','согласен...')
     else:
         box.showinfo('не ублюдок','ура)))')
     otvet = box.askyesno('asdasd','ergerherh')
     print(otvet)
コード例 #29
0
ファイル: timetracker.py プロジェクト: sasha0/timetracker
 def show_delete_project_dialog(self, project_id):
     project = session.query(Project).filter_by(id=project_id).first()
     result = messagebox.askquestion('Delete project "%s"' % project.name, 'Are You Sure?', icon='warning')
     if result == 'yes':
         session.delete(project)
         session.commit()
         self.update_projects_list()
         self.back_to_main_screen()
コード例 #30
0
def main():
    # 为了不让空窗口出现,必须导入主Tkinter模块并实例化顶层Tk对象.然后通过调用withdraw()让对象不可见
    tk = tkinter.Tk()
    tk.withdraw()  # 去掉空窗口

    print(dir(mb))

    # 注意,一些函数返回字符串,比如ok,而其他函数则返回布尔结果.最好在交互式提示符上实验它们,以便知道返回值的类型.
    # 注意,当出现Cancel时,单击它会返回None
    mb.showinfo("Title", "Your message here")
    mb.showerror("An Error", "Oops!")
    mb.showwarning("Title", "This may not work...")
    mb.askyesno("Title", "Do you love me?")
    mb.askokcancel("Title", "Are you well?")
    mb.askquestion("Title", "How are you?")
    mb.askretrycancel("Title", "Go again?")
    mb.askyesnocancel("Title", "Are you well?")
コード例 #31
0
def salirDeLaAplicacion():
    valorSalir = messagebox.askquestion("¿Desea salir de la Aplicación?")
    if valorSalir == "yes":
        root.destroy()
コード例 #32
0
def quit_function():
    repsonse = messagebox.askquestion("Confirmation",
                                      "Are you sure you want to quit?",
                                      icon="warning")
    if repsonse == "yes":
        root.destroy()
コード例 #33
0
ファイル: lab3_6v.py プロジェクト: GitH3ll/eyazis
def information():
    messagebox.askquestion("Help", "1. Input text or open file.\n"
                           "2. Send button 'Ok'.\n"
                           "3. Look at the painted syntax tree.",
                           type='ok')
コード例 #34
0
ファイル: Notepad.py プロジェクト: Paras4902/notepad
def delete():
    message = messagebox.askquestion('Notepad', "Do you want to Delete all")
    if message == "yes":
        text.delete('1.0', 'end')
    else:
        return "break"
コード例 #35
0
 def showYesNoQuestion(self, title, mess):
     response = messagebox.askquestion(title, mess)
     return response
コード例 #36
0
 def question_popup(self, title, message):
     return askquestion(title, message, icon="warning")
コード例 #37
0
def modifycus():
    cus1 = paramoops.customer()
    try:

        cus1.mobile = int(varmbn.get().strip())

        if cus1.checkmobile1() is True:
            messagebox.showinfo("CORRECT", "Mobile number found")

            if len(str(cus1.mobile)) != 0:
                set = OptionMenu(root, param1, *Options1)
                set.config(font=("Arial", 15), bg="white")
                set.grid(row=12, column=0)

                if param1.get() == Options1[0]:
                    title = "choice"
                    text = "Want to modify Age?"
                    reply = messagebox.askquestion(title, text)
                    if reply == "yes":
                        cus1.age = varAge.get()

                        while len((str(cus1.age))) == 0:
                            messagebox.showinfo("CMSPL",
                                                "ENTER YOUR Updated Age")
                            break

                        if len(str(cus1.age)) != 0:
                            cus1.modifycustomer()

                            varAge.set(cus1.age)
                            varName.set(cus1.name)
                            varId.set(cus1.id)
                            varemid.set(cus1.data)
                            varmbn.set(cus1.mobile)

                            if cus1.age != 0 and len(cus1.name) != 0 and len(
                                    cus1.id) != 0 and len(cus1.data) != 0:
                                messagebox.showinfo(
                                    "CMSPL",
                                    "CUSTOMER'S Data Updated Successfully")

                            else:
                                messagebox.showinfo(
                                    "CMSPL",
                                    "Customer particulars cannot be Updated")
                    else:
                        messagebox.showinfo("CMSPL", "Select Your choice")

                elif param1.get() == Options1[1]:
                    title = "choice"
                    text = "Want to modify Name?"
                    reply = messagebox.askquestion(title, text)
                    if reply == "yes":
                        cus1.name = varName.get().strip()

                        while len(cus1.name) == 0:
                            messagebox.showinfo("CMSPL",
                                                "Enter your updated Name")
                            break
                        if len(cus1.name) != 0:
                            cus1.modifycustomer1()

                            varName.set(cus1.name)
                            varmbn.set(cus1.mobile)
                            varAge.set(cus1.age)
                            varId.set(cus1.id)
                            varemid.set(cus1.data)

                            if cus1.age != 0 and len(cus1.name) != 0 and len(
                                    cus1.id) != 0 and len(cus1.data) != 0:
                                messagebox.showinfo(
                                    "CMSPL",
                                    "CUSTOMER'S Data Updated Successfully")

                            else:
                                messagebox.showinfo(
                                    "CMSPL",
                                    "Customer particulars cannot be Updated")
                elif param1.get() == Options1[2]:
                    title = "choice"
                    text = "Want to modify Mbno"
                    reply = messagebox.askquestion(title, text)
                    if reply == "yes":
                        cus1.mobile1 = varmbn.get().strip()

                        if cus1.checkmobile2() is True:
                            cus1.modifycustomer2()

                            varName.set(cus1.name)
                            varmbn.set(cus1.mobile1)
                            varAge.set(cus1.age)
                            varId.set(cus1.id)
                            varemid.set(cus1.data)

                            if cus1.age != 0 and len(cus1.name) != 0 and len(
                                    cus1.id) != 0 and len(cus1.data) != 0:
                                messagebox.showinfo(
                                    "CMSPL",
                                    "CUSTOMER'S Data Updated Successfully")

                            else:
                                messagebox.showinfo(
                                    "CMSPL",
                                    "Customer particulars cannot be Updated")

                else:

                    param1.get() == Options1[3]
                    title = "choice"
                    text = "Want to modify Email?"
                    reply = messagebox.askquestion(title, text)
                    if reply == "yes":
                        cus1.data = varemid.get().strip()

                        while len(cus1.data) == 0:
                            messagebox.showinfo("CMSPL",
                                                "Enter your updated Email")
                            break
                        if len(cus1.data) != 0:
                            cus1.modifycustomer3()

                            varName.set(cus1.name)
                            varmbn.set(cus1.mobile)
                            varAge.set(cus1.age)
                            varId.set(cus1.id)
                            varemid.set(cus1.data)

                            if cus1.age != 0 and len(cus1.name) != 0 and len(
                                    cus1.id) != 0 and len(cus1.data) != 0:
                                messagebox.showinfo(
                                    "CMSPL",
                                    "CUSTOMER'S Data Updated Successfully")

                            else:
                                messagebox.showinfo(
                                    "CMSPL",
                                    "Customer particulars cannot be Updated")

    except ValueError:
        messagebox.showinfo("CMSPL", "Enter Mbno")
コード例 #38
0
def bill_button_operation():
    customer_name = customerName.get()
    customer_contact = customerContact.get()
    names = []
    for i in menu_category:
        names.extend(list(order_dict[i].keys()))
    if len(names)==0:
        tmsg.showinfo("Error", "Your order list is Empty")
        return
    if customer_name=="" or customer_contact=="":
        tmsg.showinfo("Error", "Customer Details Required")
        return
    if not customerContact.get().isdigit():
        tmsg.showinfo("Error", "Invalid Customer Contact")
        return   
    ans = tmsg.askquestion("Generate Bill", "Are You Sure to Generate Bill?")
    ans = "yes"
    if ans=="yes":
        bill = Toplevel()
        bill.title("Bill")
        bill.geometry("670x500+300+100")
        bill.wm_iconbitmap("Coffee.ico")
        bill_text_area = Text(bill, font=("arial", 12))
        st = "\t\t\t\tDeva Ka Hotel\n\t\t\tM.G. Road, Lucknow-700 002\n"
        st += "\t\t\tGST.NO:- 27DSGSV45GGJVF44\n"
        st += "-"*61 + "BILL" + "-"*61 + "\nDate:- "

        #Date and time
        t = time.localtime(time.time())
        week_day_dict = {0:"Monday",1:"Tuesday",2:"Wednesday",3:"Thursday",4:"Friday",5:"Saturday",
                            6:"Sunday"}
        st += f"{t.tm_mday} / {t.tm_mon} / {t.tm_year} ({week_day_dict[t.tm_wday]})"
        st += " "*10 + f"\t\t\t\t\t\tTime:- {t.tm_hour} : {t.tm_min} : {t.tm_sec}"

        #Customer Name & Contact
        st += f"\nCustomer Name:- {customer_name}\nCustomer Contact:- {customer_contact}\n"
        st += "-"*130 + "\n" + " "*4 + "DESCRIPTION\t\t\t\t\tRATE\tQUANTITY\t\tAMOUNT\n"
        st += "-"*130 + "\n"

        #List of Items
        for i in menu_category:
            for j in order_dict[i].keys():
                lis = order_dict[i][j]
                name = lis[0]
                rate = lis[1]
                quantity = lis[2]
                price = lis[3]
                st += name + "\t\t\t\t\t" + rate + "\t      " + quantity + "\t\t  " + price + "\n\n"
        st += "-"*130

        #Total Price
        st += f"\n\t\t\tTotal price : {totalPrice.get()}\n"
        st += "-"*130

        #display bill in new window
        bill_text_area.insert(1.0, st)

        #write into file
        folder = f"{t.tm_mday},{t.tm_mon},{t.tm_year}"
        if not os.path.exists(f"Bill Records\\{folder}"):
            os.makedirs(f"Bill Records\\{folder}")
        file = open(f"Bill Records\\{folder}\\{customer_name+customer_contact}.txt", "w")
        file.write(st)
        file.close()

        #Clear operaitons
        order_tabel.delete(*order_tabel.get_children())
        for i in menu_category:
            order_dict[i] = {}
        clear_button_operation()
        update_total_price()
        customerName.set("")
        customerContact.set("")

        bill_text_area.pack(expand=True, fill=BOTH)
        bill.focus_set()
        bill.protocol("WM_DELETE_WINDOW", close_window)
コード例 #39
0
def QuitPrompt(window):
	window.quitPrompt = messagebox.askquestion("Quit", "Are You Sure you want to exit?", icon="warning")
	if window.quitPrompt.lower() == "yes":
		window.destroy()
コード例 #40
0
def salirAplicacion():
    valor = messagebox.askquestion("Salir", "¿Deseas salir de la aplicación?")
    if valor == "yes":
        root.destroy()
コード例 #41
0
from tkinter import *
from tkinter import messagebox

root = Tk()

# 设置窗口标题
root.title("主窗口")

# parent指定依托的父窗口,若不指定,默认为跟窗口
result = messagebox.askokcancel('标题', '这是内容', parent=root)
print(result)

messagebox.askquestion('标题', '这是question窗口')
messagebox.askretrycancel('标题', '这是retry cancel窗口')
messagebox.showerror('标题', '这是error窗口')
messagebox.showinfo('标题', '这是info窗口')
messagebox.showwarning('标题', '这是warning窗口')

root.mainloop()
コード例 #42
0
ファイル: main.py プロジェクト: eugeneoca/bisectionmethod
def terminate():
    result = messagebox.askquestion("Exit", "Are You Sure?", icon='question')
    if result == 'yes':
        quit()
    else:
        return
コード例 #43
0
def calc_exit():
    prompt = messagebox.askquestion('Exit', 'Do you want to exit?')
    if prompt == 'yes':
        exit()
コード例 #44
0
tix.Button(f2,
           text="info",
           bg='pink',
           command=lambda t="info", m="Information": mb.showinfo(t, m)).pack(
               fill='x', expand=True)
tix.Button(
    f2,
    text="warning",
    bg='yellow',
    command=lambda t="warning", m="Don't do it!": mb.showwarning(t, m)).pack(
        fill='x', expand=True)
tix.Button(
    f2,
    text="question",
    bg='green',
    command=lambda t="question", m="Will I?": mb.askquestion(t, m)).pack(
        fill='x', expand=True)
tix.Button(
    f2,
    text="yes-no",
    bg='lightgrey',
    command=lambda t="yes-no", m="Are you sure?": mb.askyesno(t, m)).pack(
        fill='x', expand=True)
tix.Button(f2,
           text="yes-no-cancel",
           bg='black',
           fg='white',
           command=lambda t="yes-no-cancel", m="Last chance...": mb.
           askyesnocancel(t, m)).pack(fill='x', expand=True)

f2.pack(side='top', fill='x')
コード例 #45
0
ファイル: utils.py プロジェクト: noaa-ocs-s100/s100py
def bool_question(question, title="", icon="warning"):
    root = tk.Tk()
    root.withdraw()
    result = messagebox.askquestion(title, question, icon=icon)
    return result == 'yes'
コード例 #46
0
def ask():  #this function will show the show askinfo message
    messagebox.askquestion("confirm", "Are you sure?")
コード例 #47
0
def Update() :
    resu = messagebox.askquestion(title= 'Update',message = 'Are you sure you want to update this record?')
    if resu == 'yes' :
        
        
        global bl1,w1,ep1,lp1,lf1,ef1,ll1,el1,lpno1,epno1,la1,ea1,lc1,ec1,lpi1,epi1,w2
        w1.withdraw()
        w2 = Toplevel()
        w2.geometry('500x400')
        w2.resizable(False,False)
       

        bl1 = Label(w2,text = 'Enter the values')
        bl1.pack()
        bl1.config(font = ('Times New Roman',20))
        
        
        lp1 = Label(w2,text = 'P.ID.')
        lp1.pack()
        lp1.place(x = 75,y = 70) 
        ep1 = Entry(w2)

        ep1.pack()
        ep1.place(x = 125,y = 71)
        ep1.insert(0,ep.get())
        lp1.config(font = ('Times New Roman',12))
        ep1.config(width = 8,font = ('Times New Roman',12),state='readonly')
        

        lf1 = Label(w2,text = 'First Name')
        lf1.pack()
        lf1.place(x = 42,y=110)
        ef1 = Entry(w2)

        ef1.pack()
        ef1.place(x = 124,y = 112)
        ef1.insert(0,ef.get())
        lf1.config(font = ('Times New Roman',12))
        ef1.config(width = 13,font = ('Times New Roman',12))
        

        
        ll1 = Label(w2,text = 'Last Name')
        ll1.pack()
        ll1.place(x = 43,y=150)
        el1 = Entry(w2)

        el1.pack()
        el1.place(x = 125,y = 151)
        el1.insert(0,el.get())
        ll1.config(font = ('Times New Roman',12))
        el1.config(width = 13,font = ('Times New Roman',12))
        

        
        lpno1 = Label(w2,text = 'Phone Number')
        lpno1.pack()
        lpno1.place(x = 19,y=190)
        epno1 = Entry(w2)

        epno1.pack()
        epno1.place(x = 125,y = 190)
        epno1.insert(0,epno.get())
        lpno1.config(font = ('Times New Roman',12))
        epno1.config(font = ('Times New Roman',12),width = 13)
        
        
        la1 = Label(w2,text = 'Address')
        la1.pack()
        la1.place(x = 58,y=230)
        ea1 = Entry(w2)

        ea1.pack()
        ea1.place(x = 125,y = 230)
        ea1.insert(0,ea.get())
        la1.config(font = ('Times New Roman',12))
        ea1.config(width = 25,font = ('Times New Roman',12))
        

        
        lc1 = Label(w2,text = 'City')
        lc1.pack()
        lc1.place(x = 83,y=270)
        ec1 = Entry(w2)

        ec1.pack()
        ec1.place(x = 125,y = 271)
        ec1.insert(0,ec.get())
        lc1.config(font = ('Times New Roman',12))
        ec1.config(width = 15,font = ('Times New Roman',12))
        

        lpi1 = Label(w2,text = 'Image')
        lpi1.pack()
        lpi1.place(x = 82,y = 310)
        epi1 = Entry(w2)
        epi1.pack()
        epi1.place(x = 125,y = 311)
        epi1.insert(0,pic)
        lpi1.config(font = ('Times New Roman',12))
        epi1.config(width =8 ,font = ('Times New Roman',12))
        
            
       

        bo = Button(w2,width = 5,text = 'OK',command = updateTuple)
        bo.pack()
        bo.place(y=350,x=150)

        bc = Button(w2,width = 6,text = 'Cancel',command = disable_event1)
        bc.pack()
        bc.place(y=350,x=300)

        

        w2.protocol("WM_DELETE_WINDOW", disable_event1)
コード例 #48
0
                caught += 1
                # Reset it just above the top
                i.rect.y = -1
                # Give it a new x position
                x = r.randint(0, 600)
                i.rect.x = x

            rownum += 0.5

        pg.display.flip()
        pg.time.delay(50)

    f_num = r.randint(0, 4)
    facts = [
        'Did you know:\n"91% of plastic isn\'t recycled." (National Geographic)',
        'Did you know:\n"Plastic takes more than 400 years to degrade, so most of it still exists in some form." (National Geographic)',
        'Did you know:\n"8 million metric tons of plastic ends up in the oceans every year." (National Geographic)',
        'Did you know:\nYou can replace up to 1,460 plastic water bottles by using a reusable bottle for one year. (Arcadia Power)',
        'Did you know:\n"1 to 5 trillion plastic bags are consumed worldwide everyyear. If tied together, 5 trillion plastic bags would cover an area twice the size of France." (UNEP)'
    ]
    message = "Great Job! You recycled " + str(
        caught) + " plastic water bottles!\n\n" + facts[f_num]

    messagebox.showinfo("Result", message)
    result = messagebox.askquestion("Continue",
                                    "Do you want to play again?",
                                    icon='warning')
    if result == 'no':
        pg.quit()
        sys.exit()
コード例 #49
0
def closewindow():
    """ Prompts the user when the user closes the window """
    close = askquestion(title="Closing window", message="Close Window")
    if close == 'yes':
        root.destroy()
コード例 #50
0
ファイル: PickleViewer.py プロジェクト: pavolgaj/PickleViewer
def checkForUpdates():
    print("Checking for updates...")
    req_data = urllib.request.urlopen(
        "https://raw.githubusercontent.com/Matix-Media/PickleViewer/master/versions/info.ini"
    ).read()
    body = req_data.decode("utf-8")
    config = configparser.ConfigParser()
    config.read_string(body)
    try:
        recent_version = config["RECENT"]["version"]
        recent_installer_path = config["RECENT"]["installer_path"]
        recent_version_info = urllib.request.urlopen(
            config["RECENT"]["version_info"]).read().decode("utf-8")
        recent_installer_sha = config["RECENT"]["sha256"]
        if float(recent_version) > float(software_version) or update_mode:
            print("Version outdated! Ask for download")
            question_result = messagebox.askquestion("Update",
                                                     "Your " + software_name + \
                                                     " version is outdated. Would you like to download version " + \
                                                     config["RECENT"]["version_string"] + " of " + \
                                                     software_name + "?\n\nFeatures:\n" + \
                                                     recent_version_info)
            print("Download installer?", question_result)
            if question_result == "yes":
                appdata = os.getenv("APPDATA")
                save_path = os.path.join(
                    appdata, "PickleViewer v0.7.6", "installer",
                    os.path.basename(recent_installer_path))
                print("Downloading setup to \"", save_path, "\"...", sep="")
                SB.set("Downloading \"" +
                       os.path.basename(recent_installer_path) + "\"...")
                if not os.path.isdir(os.path.dirname(save_path)):
                    print("Path \"",
                          os.path.dirname(save_path),
                          "\" does not exists, creating...",
                          sep="")
                    os.makedirs(os.path.dirname(save_path))
                urllib.request.urlretrieve(recent_installer_path, save_path)
                SB.set("Downloaded \"" +
                       os.path.basename(recent_installer_path) + "\"")
                print("Download done. Checking SHA256...")
                if getSHA(save_path) == recent_installer_sha:
                    print(
                        "SHA256 successfully verified! Starting installer...")
                    subprocess.Popen(r'explorer /run,"' + save_path + '"')
                else:
                    print(
                        "! Warning: SHA256 of installer could not be verified!"
                    )
                    messagebox.showwarning(
                        "Update",
                        "Warning: SHA256 of installer could not be verified!")
                    if messagebox.askokcancel(
                            "Update",
                            "Run installer of own risk without SHA256 verification?"
                    ):
                        print("Starting installer...")
                        subprocess.Popen(r'explorer /run,"' + save_path + '"')

        elif float(recent_version) == float(software_version):
            print("You are using the latest version of", software_name)
        elif float(recent_version) < float(software_version):
            print(
                "Wow, you are using a version, that can't be even downloaded right now!"
            )
            messagebox.showinfo("Update", "Wow, you are using a version of " + software_name + \
                                ", that can't be even downloaded right now!")
    except configparser.Error as ex:
        print("Can not read Online Version info's:", ex)
コード例 #51
0
ファイル: Notepad.py プロジェクト: Paras4902/notepad
def exitt():
    message = messagebox.askquestion('Notepad', "Do you want to save changes")
    if message == "yes":
        save_as()
    else:
        window.destroy()
コード例 #52
0
from tkinter import messagebox
name = input("짝 이름: ")
hobbit = input("짝의 관심사: ")
messagebox.showinfo("짝 이름 ", name)
messagebox.showinfo("짝 관심사", hobbit)

if hobbit == "파이썬":
    answer = messagebox.askquestion("파이썬이 확실한가요?")
    if answer == "yes":
        messagebox.showinfo("결과", "열심히하세요!")
    else:
        messagebox.showinfo("결과", "그럼 생각중이시군요!")
else:
    messagebox.showinfo("결과", "데이터 분석가가 되실 거군요")
コード例 #53
0
def salir():
    valor=messagebox.askquestion("Salir", "¿Deseas Salir de la APP?")
    if valor == "yes":
        root.destroy()
コード例 #54
0
def Click():
    replay = messagebox.askquestion('Quit?', 'Are, you sure?')
    if replay == 'yes':
        window.destroy()
コード例 #55
0
ファイル: retry.py プロジェクト: BenTildark/Project_py
            print(
                "[{}] has been added to the list. There is now {} item in the list."
                .format(item_new, len(items)))
        else:
            print(
                "[{}] has been added to the list. There are now {} items in the list."
                .format(item_new, len(items)))

    elif selection == remove_item_by_id:
        print("Remove an item.")

    elif selection == num_of_items:
        print("Display the number of items.")

    elif selection == list_items:
        print("Display a list of items.")

    elif selection == remove_all_items:
        print("Remove all items.")

    elif selection == exit_menu:
        response = messagebox.askquestion("Exit", "You sure?")
        if response.lower() == 'yes':
            print(response)
            # Jump in here if response was 'yes'
            print("Bye.")
        else:
            print(response)
            # set assignment to a blank string to get back into loop
            selection = ''
コード例 #56
0
def exit():
    message_box = messagebox.askquestion('Exit Application', 'Are you sure you want to exit the application')
    if message_box == 'yes':
        window.destroy()
    else:
        pass
コード例 #57
0
def salir():
    sino = messagebox.askquestion('salir', '¿Desea salir?')
    if sino == 'yes':
        root.destroy()
コード例 #58
0
ファイル: menu.py プロジェクト: pablolupo84/algunosEjercicios
 def salirAplicacion(self):
     opcion = messagebox.askquestion("Salir",
                                     "Desea salir de la aplicacion????",
                                     icon='warning')
     if opcion == "yes":
         self.raiz.destroy()
コード例 #59
0
from tkinter import messagebox

messagebox.showinfo('Python Progressivo', \
      'Adoro o curso Python Progressivo')

messagebox.showwarning('Python Progressivo', \
      'Adoro o curso Python Progressivo')

messagebox.showerror('Python Progressivo', \
      'Adoro o curso Python Progressivo')


messagebox.askquestion('Python Progressivo', \
      'Adoro o curso Python Progressivo')


messagebox.askokcancel('Python Progressivo', \
      'Adoro o curso Python Progressivo')


messagebox.askyesno('Python Progressivo', \
      'Adoro o curso Python Progressivo')

messagebox.askretrycancel ('Python Progressivo', \
      'Adoro o curso Python Progressivo')
コード例 #60
0
 def promptSave(self):
     if messagebox.askquestion(
             "Save",
             "Data will be lost.\nWould you like to save?") == "yes":
         self.save()