当前位置: 首页>>代码示例>>Python>>正文


Python tkMessageBox.askquestion函数代码示例

本文整理汇总了Python中tkMessageBox.askquestion函数的典型用法代码示例。如果您正苦于以下问题:Python askquestion函数的具体用法?Python askquestion怎么用?Python askquestion使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了askquestion函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: key

 def key(self, event):
     print "pressed", repr(event.char)
     if event.char == 's':
     	print 'solving'
     	answer = self.mesa.breadth()
     	#box.showinfo("Information", "Download completed")
     	decisao = box.askquestion(
         "Eight Puzzle",
         "Solução: %s. \n Deseja ver caminhos testados?" % answer
     	)
     	print decisao
     	if decisao == 'yes':
     		box.showinfo(
     		"Eight Puzzle", 
     		"%s" % self.mesa.vector_breadth_used
     		)
     if event.char == 'd':
     	print 'solving'
     	self.mesa.pre_deep()
     	answer = self.mesa.deep()
     	#box.showinfo("Information", "Download completed")
     	decisao = box.askquestion(
         "Eight Puzzle",
         "Solução: %s. \n Deseja ver caminhos testados?" % answer
     	)
     	if decisao == 'yes':
     		box.showinfo(
     		"Eight Puzzle", 
     		"%s" % self.mesa.vector_tried
     		)
开发者ID:MMSN,项目名称:eightpuzzle,代码行数:30,代码来源:jogo_final.py

示例2: p_callback

 def p_callback(self, event):
     self.parent.after_cancel( self.after_id )
     tkMessageBox.askquestion(
         title = "Paused!",
         message="Continue?",
         type=tkMessageBox.OK)
     self.after_id = self.parent.after( self.delay, self.move_my_shape )
开发者ID:antonmiakotin,项目名称:tetris_ai,代码行数:7,代码来源:GameController.py

示例3: valider

 def valider(self, event=None):
     francais = self.txtFrancais.get().strip().lower()
     etranger = self.txtEtranger.get().strip().lower()
     if francais=="":
         tkMessageBox.showwarning(_(u"Libellé incorrect"), _(u"Veuillez remplir tous les champs de cette boîte de dialogue."))
         self.txtFrancais.focus()
         return
     if etranger=="":
         tkMessageBox.showwarning(_(u"Libellé incorrect"), _(u"Veuillez remplir tous les champs de cette boîte de dialogue."))
         self.txtEtranger.focus()
         return
     (f, e, d) = self.master.master.verifierDoublons(self.langue, self.dico, francais, etranger)
     if d == True:
         tkMessageBox.showwarning(_(u"Doublons détectés"), _(u"Ce couple a déjà été entré. Vous ne pouvez pas faire de doublons."))
         self.txtEtranger.delete(0, len(self.txtEtranger.get()))
         self.txtFrancais.delete(0, len(self.txtFrancais.get()))
         self.txtFrancais.focus()
         return
     if f == True:
         if tkMessageBox.askquestion(_(u"Doublons détectés"), _(u"Le mot %s \"%s\" est déjà dans le dictionnaire. Êtes-vous certain de l'associer à un second mot %s ?") %(application_language, francais, self.langue))=="no":
             self.txtFrancais.delete(0, len(self.txtFrancais.get()))
             self.txtFrancais.focus()
             return
     if e == True:
         if tkMessageBox.askquestion(_(u"Doublons détectés"), _(u"Le mot %s \"%s\" est déjà dans le dictionnaire. Êtes-vous certain de l'associer à un second mot %s ?") %(self.langue, etranger, application_language))=="no":
             self.txtEtranger.delete(0, len(self.txtEtranger.get()))
             self.txtEtranger.focus()
             return
     self.master.master.addCouple(self.langue, self.dico, francais, etranger)
     Editer(self.master, self.langue, self.dico)
     self.destroy()
开发者ID:BackupTheBerlios,项目名称:happyboom-svn,代码行数:31,代码来源:tkinter.py

示例4: mostrar_informacion

 def mostrar_informacion(self, mensaje, titulo=""):
     """
     Muestra una ventana con el mensaje pasado por parametro.
     :param mensaje: Mensaje que se mostrara en la ventana.
     :param titulo: Titulo de la ventana.
     :return: No tiene valor de retorno.
     """
     tkMessageBox.askquestion(titulo, mensaje, type=tkMessageBox.OK, icon="info")
开发者ID:gonzaloea,项目名称:tp4-weiss-schwarz,代码行数:8,代码来源:interfaz.py

示例5: obtenerSpinbox

def obtenerSpinbox():
	#print(valor.get())
	tkMessageBox.showinfo("Mensaje","Tu seleccionaste " + valor.get())
	tkMessageBox.showwarning("Advertencia","Esto es un mensaje de Advertencia")
	tkMessageBox.askquestion("Pregunta 1", "Cualquier cosa")
	tkMessageBox.askokcancel("Pregunta 2", "Cualquier cosa")
	tkMessageBox.askyesno("Pregunta 3", "Cualquier cosa") #Responde en boleano a diferencia del question
	tkMessageBox.askretrycancel("Pregunta 1", "Cualquier cosa")
开发者ID:LIch1994,项目名称:CodigosMT,代码行数:8,代码来源:Interfaz.py

示例6: initialize

    def initialize(self):
        self.grid()
        tkMessageBox.askquestion("Use Local AWS Keys", "Use Local AWS Keys", icon='warning')

        if 'yes':
          self.LocalKeysInitiateDBConnection()
          local_keys = 2
        else:
          self.entryAWSKeyVariable = Tkinter.StringVar()
          self.entryAWSKey = Tkinter.Entry(self, textvariable=self.entryAWSKeyVariable)
          self.entryAWSKey.grid(column=0,row=0,sticky='EW')
          self.entryAWSKeyVariable.set(u"AWS Key")

          self.entryAWSSecretVariable = Tkinter.StringVar()
          self.entryAWSSecret = Tkinter.Entry(self, textvariable=self.entryAWSSecretVariable)
          self.entryAWSSecret.grid(column=0,row=1,sticky='EW')
          self.entryAWSSecretVariable.set(u"AWS Secret Key")
          local_keys = 0
          self.InputKeysInitiateDBConnection()
      
        self.entryVariable = Tkinter.StringVar()
        self.entry = Tkinter.Entry(self,textvariable=self.entryVariable)
        self.entry.grid(column=0,row=2-local_keys,sticky='EW')
        self.entry.bind("<Return>", self.OnPressEnter)
        self.entryVariable.set(u"User .gnupg directory")

        self.key_idLabelVariable = Tkinter.StringVar()
        self.key_id = Tkinter.Label(self,textvariable=self.key_idLabelVariable, anchor="w",wraplength=500)
        self.key_id.grid(column=0,row=3-local_keys,sticky='EW')
        self.key_idLabelVariable.set(u"Key ID")

        self.messageVariable = Tkinter.StringVar()
        self.message = Tkinter.Entry(self,textvariable=self.messageVariable)
        self.message.grid(column=0,row=4-local_keys,sticky='EW')
        self.message.bind("<Return>", self.OnPressEnter)
        self.messageVariable.set(u"Message")

        button = Tkinter.Button(self,text=u"Activate", command=self.OnButtonClick)
        button.grid(column=1,row=0)

        send = Tkinter.Button(self, text=u"Send", command=self.SendMessage)
        send.grid(column=1,row=1)

        recieve = Tkinter.Button(self, text=u"Recieve", command=self.OnRecieveClick)
        recieve.grid(column=1,row=2)

        self.labelVariable = Tkinter.StringVar()
        label = Tkinter.Message(self,textvariable=self.labelVariable, anchor="w")
        label.grid(column=0,row=10-local_keys,rowspan=10,sticky='EW')
        self.labelVariable.set(u"Output")

        self.grid_columnconfigure(0,weight=1)
        self.resizable(True,True)
        self.update()
        self.geometry(self.geometry())       
        self.entry.focus_set()
        self.entry.selection_range(0, Tkinter.END)
开发者ID:ihasn,项目名称:pygpg_dynodb_comms,代码行数:57,代码来源:gui.py

示例7: check_for_crash

 def check_for_crash(self,head):
     # Check for crash into a wall
     if head[0] > self.s - 1 or head[1] > self.s - 1 or head[0] < 0 or head[1] < 0:
         if tkMessageBox.askquestion("Game over: Score = " + str(len(self.snake))) == "yes":
             self.single_player_game()
         self.quit()
     # Check crash into itself
     for x in self.snake:
         if x[0] == head[0] and x[1] == head[1]:
             if tkMessageBox.askquestion("Game over1: Score = " + str(len(self.snake))) == "yes":
                 self.single_player_game()
                 break
             self.quit()
开发者ID:sandmman,项目名称:Snake,代码行数:13,代码来源:snake.py

示例8: remove_date

 def remove_date(self, presentSelection, absentSelection, showConf):
     if presentSelection:
         presentRemove = self.present_date_index[atoi(presentSelection[0])]
         if not showConf or tkMessageBox.askquestion("Deleting Confirmation", "Are you sure you want to permanently remove the date " + str(presentRemove) +" from " + str(self.curStudent) + " ?") == 'yes':
             remove_student_present_date(self.curStudent, presentRemove)
     if absentSelection:
         absentRemove = self.absent_date_index[atoi(absentSelection[0])]
         if not showConf or tkMessageBox.askquestion("Deleting Confirmation", "Are you sure you want to permanently remove the date " + absentRemove +" from " + self.curStudent + " ?") == 'yes':
             remove_student_absent_date(self.curStudent, absentRemove)
     presentDates = get_student_present_dates_from_file(self.curStudent)
     absentDates = get_student_absent_dates_from_file(self.curStudent)
     self.setEditList(presentDates, True)
     self.setEditList(absentDates, False)
开发者ID:Grindlemire,项目名称:AttendanceKeeper,代码行数:13,代码来源:main.py

示例9: onScaleButtonClick

 def onScaleButtonClick(self):
     #Check If Valid Image Directory Selected
     if(self.fileSelected):
         #Confirm File Overwrite
         choice = tkMessageBox.askquestion("Save","Overwrite Existing Image With Scaled Version?",icon="warning")
         if choice == "yes":
             #Rescale File
             image = self.scaleFile()
             #Check Image Was Scaled Successfully
             if image != None:
                 #Overwrite Selected File With Existing File
                 self.saveFile(image)
             else:
                 self.showError("Error During Image Scale!")
                 return None
         else:
             #Cancel Scale Operation
             self.showInfo("Scale Operation Cancelled!")
             return None
     else:
         self.showError("No File Selected!")
         
     #Clear File Directory
     self.fileSelected = False
     #Reset File Infov
     self.openVar.set("No File Selected")
     self.clearFileInfo()
开发者ID:whodgson,项目名称:ImageScaler,代码行数:27,代码来源:main.py

示例10: clear

	def clear(self, event=None):
		ans = tkMessageBox.askquestion(_("Delete autolevel information"),
			_("Do you want to delete all autolevel in formation?"),
			parent=self.winfo_toplevel())
		if ans!=tkMessageBox.YES: return
		self.app.gcode.probe.clear()
		self.draw()
开发者ID:samowitsch,项目名称:bCNC,代码行数:7,代码来源:ProbePage.py

示例11: restart

def restart():
    result = tkMessageBox.askquestion("Restart MazeBuilder", "Are you sure you restart.?"
                                                             "\nAll unsaved changes will be lost", icon='warning')
    if not result == "yes":
        return
    subprocess.Popen(["python", "main.py"])
    exit(0)
开发者ID:twisty-n,项目名称:MazeBuilder,代码行数:7,代码来源:MazeBuilder.py

示例12: onClear

 def onClear(self):
     if self.altAction == 1:
         self.w=popupWindow(self,title = "Enter the arguments start_level end_levels to clear\n" +
                                                              "seperated by a space.")
         self.wait_window(self.w.top)
         self.altAction = 0
         data = self.w.value.split()
         try:
             if len(data) == 2:
                 st,sto = sorted((data[0],data[1]))
                 st = int(st)
                 sto = int(sto)
                 for i in range(st,sto+1):
                     if i < len(self.levels):
                         self.levels[i] = dict()
                         self.signs[i] = dict()
                 self.redraw_level()
             else:
                 print 'Not enough arguments'
         except ValueError:
             print 'Error in values'
     else:
         if tkMessageBox.askquestion('Clear', "Clear Level: " + str(self.curr_level)) == 'yes':
             self.levels[self.curr_level] = dict()
             self.signs[self.curr_level] = dict()
             self.redraw_level()
         else:
             pass
开发者ID:fokoepxg,项目名称:CraftBuilder,代码行数:28,代码来源:craftBuilder.py

示例13: gui_addsat

 def gui_addsat(self):
     'Gui button to add the satellite tracks'
     from tkMessageBox import askquestion
     answer = askquestion('Verify import satellite tracks','Do you want to get the satellite tracks from the internet?')
     if answer == 'yes':
         from map_interactive import load_sat_from_net, get_sat_tracks, plot_sat_tracks
         self.line.tb.set_message('Loading satellite kml File from internet')
         kml = load_sat_from_net()
         if kml:
             self.line.tb.set_message('parsing file...')
             sat = get_sat_tracks(self.line.ex.datestr,kml)
             self.line.tb.set_message('Plotting satellite tracks')
             self.sat_obj = plot_sat_tracks(self.line.m,sat)
     elif answer ==  'no':
         from map_interactive import load_sat_from_file, get_sat_tracks, plot_sat_tracks
         filename = self.gui_file_select(ext='.kml',ftype=[('All files','*.*'),
                                                      ('Google Earth','*.kml')])
         if not filename:
             print 'Cancelled, no file selected'
             return
         self.line.tb.set_message('Opening kml File:'+filename)
         kml = load_sat_from_file(filename)
         self.line.tb.set_message('parsing file...')
         sat = get_sat_tracks(self.line.ex.datestr,kml)
         self.line.tb.set_message('Plotting satellite tracks') 
         self.sat_obj = plot_sat_tracks(self.line.m,sat)
     self.line.get_bg()
开发者ID:samuelleblanc,项目名称:flight_planning,代码行数:27,代码来源:gui.py

示例14: get_word

 def get_word(self):
     word = self.r.nameInput.get() or 'sb'
     #print word
     self.clean(word)
     while True:
         flag = tkMessageBox.askquestion(word)
         time.sleep(10)
开发者ID:KeyLin,项目名称:My-Dictionary,代码行数:7,代码来源:pydict.py

示例15: confirmBeginMission

def confirmBeginMission():
	result = tkMessageBox.askquestion("Begin Mission?", "Please confirm that you wish to begin the mission")
	if result == 'yes':
		print "Beginning mission"
		#put method calls here	
	else:
		print "Did not begin mission"
开发者ID:cameronellis,项目名称:AutonomousAirplaneCode,代码行数:7,代码来源:HumanOperatorGUI.py


注:本文中的tkMessageBox.askquestion函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。