• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python tkSimpleDialog.askinteger函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: save_image

def save_image(root):
    frame = cv2.imread('face_buff.jpg')
    name = tkSimpleDialog.askstring("String", "Who is this guy?")
    if name :
        dir_path = 'database/'+name

        if not os.path.exists(dir_path):
            os.makedirs(dir_path)
            ispatient = tkSimpleDialog.askinteger("Interger","Is this guy a patient? input 0 or 1")
            ischild = tkSimpleDialog.askinteger("Interger","Is this guy a child? input 0 or 1")
            add_this_guy(name,ispatient,ischild)
            print 'batabase for %s created'%name

        path, dirs, files = os.walk(dir_path).next()
        num_of_image_exits = len(files)
        print '%i images for %s'%(num_of_image_exits+1,name)
        for i in range(num_of_image_exits+1):
            if '%s_%i.jpg'%(name,i) in files:
                continue
            else:
                cv2.imwrite('%s/%s_%i.jpg'%(dir_path,name,i), frame)
                break
        try:
            os.remove('temp.jpg')
        except:
            pass
    raspi_icon()
开发者ID:huang475,项目名称:HouseKeeper,代码行数:27,代码来源:interface.py


示例2: survey

def survey():
    tkMessageBox.showinfo(title="SURVEY", message="Please rate each of the following statements on a scale from 1 to 7, with 1 being absolutely not, and 7 being absolutely yes.\n [1|2|3|4|5|6|7]")

    one = tkSimpleDialog.askinteger(title="enjoyment", prompt="I enjoyed playing Tetris.")


    two = tkSimpleDialog.askinteger(title="time", prompt="Time seemed to stand still or stop.")


    three = tkSimpleDialog.askinteger(title="tired", prompt="I couldn't tell if I was getting tired.")

    four = tkSimpleDialog.askinteger(title="drive", prompt="I felt like I couldn't stop playing.")


    five = tkSimpleDialog.askinteger(title="stress", prompt="I got wound up.")

    six = tkSimpleDialog.askinteger(title="auto", prompt="Playing seemed automatic.")

    seven = tkSimpleDialog.askinteger(title="thought", prompt="I played without thinking how to play.")

    eight = tkSimpleDialog.askinteger(title="calm", prompt="Playing made me feel calm.")



    nine = tkSimpleDialog.askinteger(title="time", prompt="I lost track of time.")

    ten = tkSimpleDialog.askinteger(title="involvement", prompt="I really got into the game.")

    return([one, two, three, four, five, six, seven, eight, nine, ten])
开发者ID:vandine,项目名称:rm_tetris,代码行数:29,代码来源:survey.py


示例3: ask_integer

def ask_integer(prompt, default=None, min=0,max=100, title=''):
	""" Get input from the user, validated to be an integer. default refers to the value which is initially in the field. By default, from 0 to 100; change this by setting max and min. Returns None on cancel."""
	import tkSimpleDialog
	if default:
		return tkSimpleDialog.askinteger(title, prompt, minvalue=min, maxvalue=max, initialvalue=default)
	else:
		return tkSimpleDialog.askinteger(title, prompt, minvalue=min, maxvalue=max)
开发者ID:downpoured,项目名称:pyxels,代码行数:7,代码来源:tkutil_dialog.py


示例4: addView

	def addView(self):
		newCamNum = tkSimpleDialog.askinteger("New camera", "New camera number:", initialvalue = 1001)
		newCamPreset = tkSimpleDialog.askinteger("New camera", "New preset number:", initialvalue = 1)
		if newCamNum == None or newCamPreset == None:
			return
		self.fov.append(fieldOfView([self.canvas.canvasx(0)+100,+self.canvas.canvasy(0)+100]))
		self.fov[-1].cam_num = newCamNum
		self.fov[-1].preset = newCamPreset
		self.selectView(len(self.fov)-1)
开发者ID:supriyomani,项目名称:cameralookup,代码行数:9,代码来源:cameralookup.py


示例5: getBlocks

def getBlocks():
	"""
    GUI to ask for block settings
    :return: Nothing
	"""
	def addBlock():
		global BlockTimes
		global BlockDoW
		BlockTimes = []
		BlockDoW = []
		for x in range(0,BlockCount):
			BlockTimes.append(Times[x].get())
			BlockDoW.append(DayStructure[x].get())

		slave2.destroy()
		getSubjects()

	"""End Sub"""

	global BlockCount
	global LunchBlock
	global BlockDoW
	Times = []
	DayStructure = []
	BlockCount = tkSimpleDialog.askinteger("bCount", "How Many Blocks in a day?", initialvalue=BlockCount)
	LunchBlock = tkSimpleDialog.askinteger("lunch", "Which block is lunch?", initialvalue=LunchBlock)
	while LunchBlock > BlockCount-1:
		showinfo("Error", "Lunch must be Less than Blocks in a day - 1")
		LunchBlock = tkSimpleDialog.askinteger("lunch", "Which block is lunch?")

	#Pad BlockTimes / BlockDoW for prepop if less than block cound
	while len(BlockTimes) < BlockCount:
		BlockTimes.append("")
		BlockDoW.append("")

	#Get block Times, slave2 = new window
	slave2 = Tk()
	for x in range(0,BlockCount):
		Label(slave2,text="Block " + str(x+1) +" Time: ").grid(row=x, column=0)
		prepop = Entry(slave2)
		prepop.insert(0, BlockTimes[x])
		Times.append(prepop)
		Times[x].grid(row=x, column=1)


		Label(slave2,text="Structure (Separate with /):").grid(row=x, column=2)
		prepop = Entry(slave2)
		prepop.insert(0, BlockDoW[x])
		DayStructure.append(prepop)
		DayStructure[x].grid(row=x, column=3)

	sub = Button(slave2, text="Submit", command=addBlock)
	sub.grid(row=BlockCount+1, column=1)
开发者ID:srvrana,项目名称:Bavadoov,代码行数:53,代码来源:EarlyDev.py


示例6: PrintLabel

 def PrintLabel(self):
     lps = self._CreateLojeProductGenerator()
     barcode = tkSimpleDialog.askinteger(self.MSG_TITLE, self.MSG_TYPE_BARCODE, parent=self)
     if not (lps and barcode): return
     ident = tkSimpleDialog.askstring(self.MSG_TITLE, self.MSG_IDENT_CODE, parent=self)
     if not ident: return
     count = tkSimpleDialog.askinteger(
         self.MSG_TITLE, self.MSG_LABEL_COUNT, initialvalue=1, parent=self
         )
     if not count: return
     try:
         sheet = lps.GenerateLojeProductSheet([ident] * count, barcode)
     except ProductCodeError, exc:
         tkMessageBox.showerror(self.MSG_TITLE, exc)
         return
开发者ID:igortg,项目名称:lojetools,代码行数:15,代码来源:lojeproductsheet_ui.py


示例7: obtener_entero

 def obtener_entero(self, mensaje, titulo="", intervalo=[]):
     """
     Pide al usuario que ingrese un numero entero, mostrando el mensaje pasado por parametro. Si se recibe un 
     intervalo, el numero debe pertenecer al mismo.
     :param mensaje: Mensaje a mostrar en la ventana al pedir el numero.
     :param titulo: Titulo de la ventana.
     :param intervalo: Lista de dos numeros, de la forma [min, max]. Si se recibe, el numero que se pida debe ser 
                       mayor o igual a min y menor o igual a max. Se seguira pidiendo al usuario que ingrese un 
                       numero hasta que se cumplan las condiciones.
     :return: Numero entero ingresado por el usuario.
     """
     if not intervalo:
         return tkSimpleDialog.askinteger(titulo, mensaje, parent=self.tk_window)
     return tkSimpleDialog.askinteger(titulo, mensaje, parent=self.tk_window, minvalue=intervalo[0],
                                      maxvalue=intervalo[1])
开发者ID:gonzaloea,项目名称:tp4-weiss-schwarz,代码行数:15,代码来源:interfaz.py


示例8: open_new

    def open_new (self):
        n_col = tkSimpleDialog.askinteger ("N_Colors", "Enter the number "\
                                           "of colors in new lookup table.",
                                           initialvalue=16, 
                                           minvalue=0,
                                           maxvalue=LUT_EDITOR_MAX_COLORS,
                                           parent=self.root)
        if n_col is None:
            return None

        cur_col = ((0,0,255), '#0000fe')
        ans = tkMessageBox.askyesno ("Choose color?", 
                                     "Choose individual colors? "\
                                     "Answer no to choose one color only.")
        if ans == 1:        
            for i in range (0, n_col):
                col = tkColorChooser.askcolor (title="Color number %d"%(i),
                                               initialcolor=cur_col[1])
                if col[1] is not None:
                    self.lut.append (tk_2_lut_color (col[0]))
                    cur_col = col
                else:
                    self.lut.append (tk_2_lut_color (cur_col[0]))
        else:
            col = tkColorChooser.askcolor (title="Choose default color", 
                                           initialcolor=cur_col[1])
            if col[1] is None:
                col = cur_col
            for i in range (0, n_col):
                self.lut.append (tk_2_lut_color (col[0]))
            
        self.lut_changed = 1
        self.initialize ()
开发者ID:sldion,项目名称:DNACC,代码行数:33,代码来源:Lut_Editor.py


示例9: input

    def input(self):
        value = None
        edited = False
        print "getting input!!"
        """
        self.text.config(state="normal")
        self.text.insert(END, ">>> ")
        start = self.text.index("current")
        def back(self, event=None):
            current = self.text.index("current")
            ln, col = current.split(".")
            col_s = start.split(".")[1]
            if int(col) < int(col_s):
                self.text.delete(current, END)

        def validate(self, event=None):
            current = self.text.index("current")
            value = self.text.get(start, current)
            edited = True
            self.text.insert(END, "\n")
            return value
        self.bind("<BackSpace>", back)
        self.text.config(state="disable")
        self.text.bin("<Return>", validate)
        return value
        """
        res = simpledialog.askinteger("Input", "Enter an integer!")
        #dia = simpledialog.SimpleDialog(self, "input a value", title="yes")
        return res
开发者ID:afranck64,项目名称:PySam,代码行数:29,代码来源:GConsole.py


示例10: _AskInitialBarcode

 def _AskInitialBarcode(self, lpg):
     initial_barcode = tkSimpleDialog.askinteger(
         self.MSG_TITLE, 
         self.MSG_TYPE_BARCODE + "Inicial", 
         initialvalue=lpg.AcquireInitialBarcode(),
         parent=self)
     return initial_barcode
开发者ID:igortg,项目名称:lojetools,代码行数:7,代码来源:lojeproductsheet_ui.py


示例11: change_total

def change_total():
    global stats,attributes,app
    new_total=tkSimpleDialog.askinteger("Change Total","Enter a new total:")
    if new_total==None: return False
    if new_total<0: new_total=0
    stats=statdist.StatDist(attributes,new_total)
    app.update_values()
开发者ID:Volvagia356,项目名称:genometranscendence-statdist,代码行数:7,代码来源:gui.py


示例12: popup

def popup(which, message, title=None):
    """Displays A Pop-Up Message."""
    if title is None:
        title = which
    which = superformat(which)
    if which == "info":
        return tkMessageBox.showinfo(str(title), str(message))
    elif which == "warning":
        return tkMessageBox.showwarning(str(title), str(message))
    elif which == "error":
        return tkMessageBox.showerror(str(title), str(message))
    elif which == "question":
        return tkMessageBox.askquestion(str(title), str(message))
    elif which == "proceed":
        return tkMessageBox.askokcancel(str(title), str(message))
    elif which == "yesorno":
        return tkMessageBox.askyesno(str(title), str(message))
    elif which == "retry":
        return tkMessageBox.askretrycancel(str(title), str(message))
    elif which == "entry":
        return tkSimpleDialog.askstring(str(title), str(message))
    elif which == "integer":
        return tkSimpleDialog.askinteger(str(title), str(message))
    elif which == "float":
        return tkSimpleDialog.askfloat(str(title), str(message))
开发者ID:evhub,项目名称:rabbit,代码行数:25,代码来源:gui.py


示例13: getCountRateHist

    def getCountRateHist(self):
        '''Plots a histogram of the count rate.  The number of bins is 
        for the histogram, and the sample length is how long the count rate
        is averaged over (equivalent to "sample length" for the count rate
        vs. time graph.'''

        #check if data has been imported. if not, give a warning
        if self.dataSet:

            #ask for number of bins for histogram
            labelText = "Enter the number of bins"
            numBins = tksd.askinteger("Count Rate Histogram", labelText, parent=self.root, minvalue=1)
            if not numBins:
                return

            #ask for length of sample to calculate count rate
            labelText = "Enter the sample length (seconds)"
            sampleLength = tksd.askfloat("Sample Length", labelText, parent=self.root, minvalue=0)
            if not sampleLength:
                return

            #plot histogram in matplotlib
            pd.plotHistOfCountRates(self.dataSet, sampleLength, numBins)

        else:
            self.showImportAlert()
开发者ID:samkohn,项目名称:Geiger-Counter,代码行数:26,代码来源:GUI.py


示例14: __init__

    def __init__(self, env, title = 'Progra IA', cellwidth=50):

        # Initialize window

        super(EnvFrame, self).__init__()
        self.title(title)        
        self.withdraw()
        # Create components
        self.customFont = tkFont.Font(family="Calibri", size=11)
        self.option_add('*Label*font', self.customFont)        
        
        size=tkSimpleDialog.askinteger("Crear Ambiente","Ingrese el tamaño del tablero",parent=self)
        env = VacuumEnvironment(size+2);
        #env = VacuumEnvironment();
        self.update()
        self.deiconify()
        self.configure(background='white')
        self.canvas = EnvCanvas(self, env, cellwidth)
        toolbar = EnvToolbar(self, env, self.canvas)
        for w in [self.canvas, toolbar]:
            w.pack(side="bottom", fill="x", padx="3", pady="3")

        Ventana = self
        Canvas = self.canvas
        self.canvas.pack()
        toolbar.pack()
        tk.mainloop()
开发者ID:jmezaschmidt,项目名称:Agents_IA_Project_1,代码行数:27,代码来源:agents.py


示例15: checkIn

 def checkIn(self):
     tkMessageBox.showwarning(title="SESSION ENDED",
                              message ="Score: %7d\tLevel: %d\n Ready to move on?" % ( self.score, self.level), parent=self.parent)
     self.enjoyNoSpeed = tkSimpleDialog.askinteger(title='Question', prompt="On a scale from 1 to 7 with 1 being not enjoyable at all, and 7 being as enjoyable as possible, how fun was this?")
     survey_ans = survey.survey.survey()
     self.writeData(BOOK, SHEET,SHEETNAME, SESSION)
     excel_data.survey_ans.write_survey_ans(BOOK, SHEET, SHEETNAME, survey_ans, SESSION)
开发者ID:vandine,项目名称:rm_tetris,代码行数:7,代码来源:tetris_tk_final.py


示例16: keybdGoToSite

 def keybdGoToSite(self, event):
     import tkSimpleDialog
     answer = tkSimpleDialog.askinteger('Go to site','Enter site (0 or larger)',minvalue=0)      
     if answer is not None:
         self.site = answer
         self.setTitle()
         self.plotter.repaint()
开发者ID:danielfan,项目名称:Phycas,代码行数:7,代码来源:TreeViewer.py


示例17: align_images

def align_images(im1, im2):

	# Convert images to grayscale
	im1_gray = cv2.cvtColor(im1,cv2.COLOR_BGR2GRAY)
	im2_gray = cv2.cvtColor(im2,cv2.COLOR_BGR2GRAY)
 
	# Find size of image1
	sz = im1.shape

	# Define the motion model
	warp_mode = cv2.MOTION_HOMOGRAPHY
	
	#Define the warp matrix
	warp_matrix = np.eye(3, 3, dtype=np.float32)

	#Define the number of iterations
	number_of_iterations = askinteger("Iterations", "Enter a number between 5 andd 5000",initialvalue=500,minvalue=5,maxvalue=5000)

	#Define correllation coefficient threshold
	#Specify the threshold of the increment in the correlation coefficient between two iterations
	termination_eps = askfloat("Threshold", "Enter a number between 1e-10 and 1e-50",initialvalue=1e-10,minvalue=1e-50,maxvalue=1e-10)

	#Define termination criteria
	criteria = (cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, number_of_iterations,  termination_eps)
 
	#Run the ECC algorithm. The results are stored in warp_matrix.
	(cc, warp_matrix) = cv2.findTransformECC (im1_gray,im2_gray,warp_matrix, warp_mode, criteria)

	#Use warpPerspective for Homography 
	im_aligned = cv2.warpPerspective (im2, warp_matrix, (sz[1],sz[0]), flags=cv2.INTER_LINEAR + cv2.WARP_INVERSE_MAP)
	
	save1 = asksaveasfilename(defaultextension=".jpg", title="Save aligned image")
	cv2.imwrite(save1,im_aligned)
开发者ID:TheJark,项目名称:Image-Matching,代码行数:33,代码来源:image_align2.py


示例18: getSubjects

def getSubjects():
	"""
	GUI to get subject lists
	:return: Nothing
	"""
	def addSubject():
		global Subjects
		Subjects = []
		for x in range(0,SubCount):
			Subjects.append(Subs[x].get())
		slave3.destroy()
		Generate()
	"""End Sub"""

	global SubCount
	global Subjects
	Subs = []

	SubCount = tkSimpleDialog.askinteger("Sub", "How Many Subjects do we Have?", initialvalue= SubCount)

	#pad Subject[] for prepop and adding subjects
	while len(Subjects) < SubCount:
		Subjects.append("")

	slave3 = Tk()
	Label(slave3,text="Subjects:").grid(row=0, column=0)
	for x in range(0,SubCount):
		prepop = Entry(slave3)
		prepop.insert(0, Subjects[x])
		Subs.append(prepop)
		Subs[x].grid(row=x+1, column=0)

	sub = Button(slave3, text="Submit", command=lambda : addSubject())
	sub.grid(row=SubCount+1, column=1)
开发者ID:srvrana,项目名称:Bavadoov,代码行数:34,代码来源:EarlyDev.py


示例19: GoToSlice

 def GoToSlice():
     sliceIndex = tkSimpleDialog.askinteger("GoTo Slice"," Index : ")
     if not sliceIndex: return
     smin,smax = Globals.imagePipeline.GetAxisExtent()
     sliceIndex = min(smax, sliceIndex)
     sliceIndex = max(smin, sliceIndex)
     self.SetSlice(sliceIndex)
     self.scaleSlice.set(sliceIndex)
开发者ID:ewong718,项目名称:freesurfer,代码行数:8,代码来源:pyScout.py


示例20: newGame

	def newGame(self):
		if self.game!=None:
			self.game.deregisterCallBacks()
		lowBlind = askinteger("Table Options", "Small Blind", initialvalue="5")
		if lowBlind==None:
			lowBlind=5
		highBlind = askinteger("Table Options", "Large Blind", initialvalue="10")
		if highBlind==None:
			highBlind=10
		self.game = Holdem(lowBlind,highBlind, debug=True, manual = self.manual)
		print self.game.stage
		self.game.registerCallBack(HoldemGUI.toggleButtons, self)
		self.game.registerCallBack(HoldemGUI.updateAction, self)
		self.cleanUpCards()
		self.displayPocketCards(2)
		self.toggleButtons()
		self.playHand()
开发者ID:hicannon,项目名称:Holdem-Bot,代码行数:17,代码来源:gui.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python tkSimpleDialog.askstring函数代码示例发布时间:2022-05-27
下一篇:
Python tkSimpleDialog.askfloat函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap