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


Python simpledialog.askinteger函数代码示例

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


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

示例1: generatePDF

    def generatePDF(self):
        try:
            i = max(self.lPaid + self.lUnpaid)
        except:
            i = 0

        downloadFile(FILENAME)

        numberOfPermissions = simpledialog.askinteger('Antal', 'Hur många tillstånd?')

        while numberOfPermissions != None and numberOfPermissions % 3 != 0:
            tk.messagebox.showinfo('Fel', 'Måste vara jämt delbart med tre!')
            numberOfPermissions = simpledialog.askinteger('Antal', 'Hur många tillstånd?')

        if numberOfPermissions:
            self.updateListOfUnpaid(i, numberOfPermissions)
            fileName = creatPermissionPDF(self.apartmentNumber, i+1, numberOfPermissions)

            updateFile_PaidUnpaid(self.apartmentNumber, self.dPaid_dates, self.lUnpaid)

            if self.checkButtonVal.get():
                sendEmail(fileName, self.lEmail, 'Parkeringstillstånd', 'Här kommer dina parkeringstillstånd!')

            else:
                webbrowser.open_new(r'%s' % fileName)
开发者ID:wixenius,项目名称:PDFGUI,代码行数:25,代码来源:MainGUI.py

示例2: reserve_Button

    def reserve_Button(self):
        # Input the information
        input_id_value = simpledialog.askinteger("test", "Please enter customer ID: ")
        Input_Date_value = simpledialog.askstring("test","Please enter date for reservation: ") 
        Input_Time_value = simpledialog.askstring("test","Please enter time for reservation: ")
        InputService_value = simpledialog.askstring("test","Which services do you want?")
        length_value = simpledialog.askinteger("test", "For how long?")

        ServiceObject = eval(InputService_value)
        ServiceObject.reserve(input_id_value, Input_Date_value, Input_Time_value, length_value, InputService_value)
开发者ID:jennyapple123,项目名称:IST303_GroupProject_MW,代码行数:10,代码来源:IST303Project.py

示例3: set_child_cap

 def set_child_cap():
     """Requests new child cap from the user."""
     child_split = list(lnp.settings.childcap.split(':'))
     child_split.append('0')  # In case syntax is invalid
     v = simpledialog.askinteger(
         "Settings", "Absolute cap on babies + children:",
         initialvalue=child_split[0])
     if v is not None:
         v2 = simpledialog.askinteger(
             "Settings", "Max percentage of children in fort:\n"
             "(lowest of the two values will be used as the cap)",
             initialvalue=child_split[1])
         if v2 is not None:
             df.set_option('childcap', str(v)+':'+str(v2))
             binding.update()
开发者ID:PeridexisErrant,项目名称:python-lnp,代码行数:15,代码来源:options.py

示例4: parameterSelected

 def parameterSelected(self, selectPos):
   """Callback when a parameter is selected"""
   tmParamExtraction = self.tmParamExtractions[selectPos]
   name = tmParamExtraction.name
   descr = tmParamExtraction.descr
   paramType = tmParamExtraction.valueType
   value = self.tmParamValues[selectPos]
   if paramType == UTIL.DU.BITS or paramType == UTIL.DU.SBITS or \
      paramType == UTIL.DU.UNSIGNED or paramType == UTIL.DU.SIGNED:
     answer = simpledialog.askinteger("Integer Parameter",
                                      descr + ": " + name,
                                      parent=self,
                                      initialvalue=value)
   elif paramType == UTIL.DU.BYTES or paramType == UTIL.DU.FLOAT or \
        paramType == UTIL.DU.TIME or paramType == UTIL.DU.STRING:
     answer = simpledialog.askstring("String Parameter",
                                     descr + ": " + name,
                                     parent=self,
                                     initialvalue=value)
   else:
     answer = None
   if answer == None:
     return
   # new parameter value entered --> update param value entry and list
   newValue = answer
   self.tmParamValues[selectPos] = newValue
   text = tmParamExtraction.descr + ": " + tmParamExtraction.name + " = " + str(newValue)
   self.parametersListbox.list().delete(selectPos)
   self.parametersListbox.list().insert(selectPos, text)
开发者ID:Stefan-Korner,项目名称:SpacePyLibrary,代码行数:29,代码来源:SPACEgui.py

示例5: paramClicked

 def paramClicked(self, param, nodeID):
   """callback when a Param node is clicked"""
   innerTree = self.tree()
   if param.isReadOnly():
     return
   nodeKey = innerTree.item(nodeID, "text")
   nodeValues = innerTree.item(nodeID, "value")
   name = nodeValues[0]
   value = nodeValues[1]
   paramType = param.getParamType()
   if paramType == UTIL.DU.BITS or paramType == UTIL.DU.SBITS or \
      paramType == UTIL.DU.UNSIGNED or paramType == UTIL.DU.SIGNED:
     answer = simpledialog.askinteger("Integer Parameter",
                                      nodeKey + ": " + name,
                                      parent=self,
                                      initialvalue=value)
   elif paramType == UTIL.DU.BYTES or paramType == UTIL.DU.FLOAT or \
        paramType == UTIL.DU.TIME or paramType == UTIL.DU.STRING:
     answer = simpledialog.askstring("String Parameter",
                                     nodeKey + ": " + name,
                                     parent=self,
                                     initialvalue=value)
   else:
     answer = None
   if answer == None:
     return
   # new parameter value entered --> update param object and tree
   newValue = answer
   param.value = newValue
   innerTree.set(nodeID, 1, newValue)
开发者ID:Stefan-Korner,项目名称:SpacePyLibrary,代码行数:30,代码来源:VPgui.py

示例6: inputdata

def inputdata():
	x = tkSimpleDialog.askinteger("Input","Multiplier")
	if x:
		tkMessageBox.showwarning("Yes",x)
		listbox.insert(END, x)
	else:
		tkMessageBox.showwarning("No","You did it wrong")
开发者ID:CWade3051,项目名称:Py,代码行数:7,代码来源:test+copy.py

示例7: delete_rode

    def delete_rode(self, event):
        if Rodstable.count == 0:
            showerror('Ошибка удаления', 'В таблице не осталось заполненных полей')
            return

        number_to_del = askinteger('', 'Введите № стержня:', parent=self)
        if number_to_del not in Rodstable.dict_items:
            showwarning('Предупреждение', 'Вы пытаетесь удалить стержень, которого '
                                          'не существует', parent=self)
            return

        self.clear_table()

        Rodstable.dict_items.pop(number_to_del)
        Rodstable.count -= 1
        for item in Rodstable.dict_items:
            if item > number_to_del:
                Rodstable.dict_items[item - 1] = (Rodstable.dict_items[item][0],
                                                  Rodstable.dict_items[item][1],
                                                  Rodstable.dict_items[item][2],
                                                  Rodstable.dict_items[item][3],
                                                  Rodstable.dict_items[item][4])
                Rodstable.dict_items.pop(item)

        self.fill_table()
开发者ID:fargelus,项目名称:SAPR,代码行数:25,代码来源:rodstable.py

示例8: plotRate

 def plotRate(Kn, K1, KnSD, K1SD, CONC, antib):
     Kn1=Kn/K1
     SDkn1=(Kn/K1)*np.sqrt(((KnSD/Kn)**2)+((K1SD/K1)**2))
     
     fig=plt.figure()
     ax = fig.add_subplot(111)
     ax.errorbar(CONC, Kn1,yerr=SDkn1,color='g',label='$'+str('wt')+str(antib)+'- %s$' % str('Kn/K1'))
     ax.legend(fontsize=16)
     #ax.set_xlim([-1,max()]) 
     ax.set_ylim([0.001,1.5])
     if x_ax==True:
         xe=simpledialog.askinteger('X_lim','set_xlim')
     else:
         xe=max(conc[str(ant)])
     ax.set_xlim([0,xe])
     
     ax.set_yscale('linear',fontsize=16)
     ax.set_xscale('linear',fontsize=16)
     ax.tick_params(axis='x', labelsize=14)
     ax.tick_params(axis='y', labelsize=14)
     plt.ylabel('Kn/K1',fontsize=16)
     plt.xlabel('Conc '+str(antib)+ ' (microM)',fontsize=16)
     ax.grid(True) 
     #fig.savefig(str(antib)+str(n1)+':'+str(n2)+'.pdf')
     return fig
开发者ID:donevswe,项目名称:Python-Plots,代码行数:25,代码来源:TKINTER_RatesTrimMupTc_WT.py

示例9: set_pop_cap

 def set_pop_cap(self):
     """Requests new population cap from the user."""
     v = simpledialog.askinteger(
         "Settings", "Population cap:",
         initialvalue=self.lnp.settings.popcap, parent=self.root)
     if v is not None:
         self.lnp.set_option('popcap', v)
         self.update_displays()
开发者ID:MagiX13,项目名称:pyLNP,代码行数:8,代码来源:tkgui.py

示例10: set_graze_coef

 def set_graze_coef():
     """Requests new graze coefficient from the user."""
     v = simpledialog.askinteger(
         "Settings", "Graze coefficient:",
         initialvalue=lnp.settings.grazeCoef)
     if v is not None:
         df.set_option('grazeCoef', str(v))
         binding.update()
开发者ID:PeridexisErrant,项目名称:python-lnp,代码行数:8,代码来源:options.py

示例11: set_pop_cap

 def set_pop_cap(self):
     """Requests new population cap from the user."""
     v = simpledialog.askinteger(
         "Settings", "Population cap:",
         initialvalue=self.lnp.settings.popcap)
     if v is not None:
         self.lnp.set_option('popcap', str(v))
         binding.update()
开发者ID:Estevo-Aleixo,项目名称:pylnp,代码行数:8,代码来源:options.py

示例12: set_strict_pop_cap

 def set_strict_pop_cap():
     """Requests new strict population cap from the user."""
     v = simpledialog.askinteger(
         "Settings", "Strict population cap:",
         initialvalue=lnp.settings.strictPopcap)
     if v is not None:
         df.set_option('strictPopcap', str(v))
         binding.update()
开发者ID:PeridexisErrant,项目名称:python-lnp,代码行数:8,代码来源:options.py

示例13: getN_NumMines

    def getN_NumMines(self, **kwargs):
        """
		gets N and num_mines {from the user in text mode|from the kwargs in test mode}
	"""
        if self.app_type == 'text':
            N = int(input('Please input the size of board (e.g., 16): '))
            num_mines = int(input('Please input the number of mines (e.g., 15): '))
            return N, num_mines
        elif self.app_type == 'test':
            N = kwargs['N']
            num_mines = kwargs['num_mines']
            return N, num_mines
        elif self.app_type == 'gui':
            master = kwargs['master']
            master.withdraw()
            N = simpledialog.askinteger('Minesweeper','Enter Size of Map:',minvalue=1,maxvalue=25)#TODO: check min/max
            num_mines = simpledialog.askinteger('Minesweeper','Enter Number of Mines:',minvalue=1, maxvalue=N*N-1) #TODO: check min/max
            return N, num_mines
开发者ID:AmirooR,项目名称:minesweper-py3k,代码行数:18,代码来源:mineGUI.py

示例14: gotoQuestion

def gotoQuestion():
  global socket, running
  if running:
    questionNo = simpledialog.askinteger("Go to question...", "Question Number:")
    if questionNo:
      disableButton()
      network.sendMessage('gotoQu', questionNo, socket)
  else:
    messagebox.showerror("Error", "Server has not Started Running Yet!")
开发者ID:william1616,项目名称:WeakestLink,代码行数:9,代码来源:control.py

示例15: node_modify

 def node_modify(self, event):
     i = self.get_node_at_coord(event.x, event.y)
     if not i:
         return
     weight = simpledialog.askinteger("Weight", "Enter weight of node {}".format(i),
                                      initialvalue=self.nodes[i]['weight'])
     if weight:
         self.nodes[i]['weight'] = weight
     self.redraw()
开发者ID:rrader,项目名称:scheduler,代码行数:9,代码来源:ui.py


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