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


Python simpledialog.askfloat方法代码示例

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


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

示例1: numinput

# 需要导入模块: from tkinter import simpledialog [as 别名]
# 或者: from tkinter.simpledialog import askfloat [as 别名]
def numinput(self, title, prompt, default=None, minval=None, maxval=None):
        """Pop up a dialog window for input of a number.

        Arguments: title is the title of the dialog window,
        prompt is a text mostly describing what numerical information to input.
        default: default value
        minval: minimum value for imput
        maxval: maximum value for input

        The number input must be in the range minval .. maxval if these are
        given. If not, a hint is issued and the dialog remains open for
        correction. Return the number input.
        If the dialog is canceled,  return None.

        Example (for a TurtleScreen instance named screen):
        >>> screen.numinput("Poker", "Your stakes:", 1000, minval=10, maxval=10000)

        """
        return simpledialog.askfloat(title, prompt, initialvalue=default,
                                     minvalue=minval, maxvalue=maxval)


##############################################################################
###                  End of Tkinter - interface                            ###
############################################################################## 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:27,代码来源:turtle.py

示例2: exportVTK

# 需要导入模块: from tkinter import simpledialog [as 别名]
# 或者: from tkinter.simpledialog import askfloat [as 别名]
def exportVTK(self,proj):                    
        outfile = fd.asksaveasfilename()
        if outfile is not '':
            #thickness = sd.askfloat("Input","Profile thickness [m]")
            thickness = 0
            if self.asp is None:
                aspect = 1.0
            else:
                aspect = self.asp
            
            if proj.threeD is None:
                gpyes = mesbox.askyesno("Question","Do you have topography data for this profile?")
                if gpyes:
                    filename = fd.askopenfilename()
                    self.getDelimiter()
                    proj.exportVTK(outfile,gpsinfo=filename,thickness=thickness,delimiter=self.delimiter,aspect=aspect)
            else:
                proj.exportVTK(outfile,gpsinfo=proj.threeD,thickness=thickness,delimiter=self.delimiter,aspect=aspect)
            print('... done with exporting to VTK.') 
开发者ID:NSGeophysics,项目名称:GPRPy,代码行数:21,代码来源:gprpyGUI.py

示例3: numinput

# 需要导入模块: from tkinter import simpledialog [as 别名]
# 或者: from tkinter.simpledialog import askfloat [as 别名]
def numinput(title, prompt, default=None, minval=None, maxval=None,
             nullable=False, askint=False):
    root = tk.Tk()
    root.withdraw()
    ask = simpledialog.askinteger if askint else simpledialog.askfloat
    ans = ask(
        title, prompt, initialvalue=default, minvalue=minval, maxvalue=maxval)
    if ans == 0:
        return ans
    elif not ans and not nullable:
        return numinput(
            title, prompt, default=default, minval=minval, maxval=maxval,
            nullable=nullable, askint=askint)
    return ans 
开发者ID:int-brain-lab,项目名称:ibllib,代码行数:16,代码来源:graphic.py

示例4: setYrng

# 需要导入模块: from tkinter import simpledialog [as 别名]
# 或者: from tkinter.simpledialog import askfloat [as 别名]
def setYrng(self):
        ylow = sd.askfloat("Input","Min Y value")
        if ylow is not None:            
            yhigh = sd.askfloat("Input","Max Y value")
            if yhigh is not None:
                self.prevyrng=self.yrng
                self.yrng=[ylow,yhigh] 
开发者ID:NSGeophysics,项目名称:GPRPy,代码行数:9,代码来源:gprpyGUI.py

示例5: setAspect

# 需要导入模块: from tkinter import simpledialog [as 别名]
# 或者: from tkinter.simpledialog import askfloat [as 别名]
def setAspect(self):
        self.asp = sd.askfloat("Input","Plotting aspect ratio") 
开发者ID:NSGeophysics,项目名称:GPRPy,代码行数:4,代码来源:gprpyGUI.py

示例6: setXrng

# 需要导入模块: from tkinter import simpledialog [as 别名]
# 或者: from tkinter.simpledialog import askfloat [as 别名]
def setXrng(self):
        xlow = sd.askfloat("Input","Min X value")
        if xlow is not None:
            xhigh = sd.askfloat("Input","Max X value")
            if xhigh is not None:
                self.xrng=[xlow,xhigh] 
开发者ID:NSGeophysics,项目名称:GPRPy,代码行数:8,代码来源:gprpyGUI.py

示例7: adjProfile

# 需要导入模块: from tkinter import simpledialog [as 别名]
# 或者: from tkinter.simpledialog import askfloat [as 别名]
def adjProfile(self,proj):
        flipit = mesbox.askyesno("Question","Flip the profile (left to right)?")
        if flipit:
            proj.flipProfile()        
        minPos = sd.askfloat("Input","Start x coordinate")
        if minPos is not None:
            maxPos = sd.askfloat("Input","End x coordinate")
            if maxPos is not None:
                proj.adjProfile(minPos=minPos,maxPos=maxPos)
                self.xrng=[minPos,maxPos] 
开发者ID:NSGeophysics,项目名称:GPRPy,代码行数:12,代码来源:gprpyGUI.py

示例8: setZeroTime

# 需要导入模块: from tkinter import simpledialog [as 别名]
# 或者: from tkinter.simpledialog import askfloat [as 别名]
def setZeroTime(self,proj):
        newZeroTime = sd.askfloat("Input","New zero time")
        if newZeroTime is not None:
            proj.setZeroTime(newZeroTime=newZeroTime) 
开发者ID:NSGeophysics,项目名称:GPRPy,代码行数:6,代码来源:gprpyGUI.py

示例9: truncateY

# 需要导入模块: from tkinter import simpledialog [as 别名]
# 或者: from tkinter.simpledialog import askfloat [as 别名]
def truncateY(self,proj):
        maxY = sd.askfloat("Input","Truncate at what y value\n" 
                           "(two-way travel time or depth)")
        if maxY is not None:
            proj.truncateY(maxY) 
开发者ID:NSGeophysics,项目名称:GPRPy,代码行数:7,代码来源:gprpyGUI.py

示例10: cut

# 需要导入模块: from tkinter import simpledialog [as 别名]
# 或者: from tkinter.simpledialog import askfloat [as 别名]
def cut(self,proj):
        minX = sd.askfloat("Input","Minimum profile position")
        if minX is not None:
            maxX = sd.askfloat("Input","Maximum profile position")
            if maxX is not None:
                proj.cut(minX,maxX) 
开发者ID:NSGeophysics,项目名称:GPRPy,代码行数:8,代码来源:gprpyGUI.py

示例11: setVelocity

# 需要导入模块: from tkinter import simpledialog [as 别名]
# 或者: from tkinter.simpledialog import askfloat [as 别名]
def setVelocity(self,proj):
        velocity =  sd.askfloat("Input","Radar wave velocity [m/ns]?")        
        if velocity is not None:
            proj.setVelocity(velocity)
            self.prevyrng=self.yrng
            self.yrng=[0,np.max(proj.depth)] 
开发者ID:NSGeophysics,项目名称:GPRPy,代码行数:8,代码来源:gprpyGUI.py

示例12: showHyp

# 需要导入模块: from tkinter import simpledialog [as 别名]
# 或者: from tkinter.simpledialog import askfloat [as 别名]
def showHyp(self,proj,a):
        x0 = sd.askfloat("Input","Hyperbola center on profile [m]")
        if x0 is not None:
            t0 = sd.askfloat("Input","Hyperbola apex location (two-way travel time [ns])")
            if t0 is not None:
                v  = sd.askfloat("Input","Estimated velocity [m/ns]")
                if v is not None:
                    y=proj.profilePos-x0
                    d=v*t0/2.0
                    k=np.sqrt(d**2 + np.power(y,2))
                    t2=2*k/v
                    a.plot(proj.profilePos,t2,'--c',linewidth=3) 
开发者ID:NSGeophysics,项目名称:GPRPy,代码行数:14,代码来源:gprpyGUI.py

示例13: setVelRng

# 需要导入模块: from tkinter import simpledialog [as 别名]
# 或者: from tkinter.simpledialog import askfloat [as 别名]
def setVelRng(self):
        vmin = sd.askfloat("Input","Minimum velocity")
        if vmin is not None:
            self.vmin = vmin
        vmax = sd.askfloat("Input","Maximum velocity")
        if vmax is not None:
            self.vmax = vmax
        vint = sd.askfloat("Input","Velocity step size (interval)")
        if vint is not None:
            self.vint = vint 
开发者ID:NSGeophysics,项目名称:GPRPy,代码行数:12,代码来源:gprpyCWGUI.py

示例14: adjProfile

# 需要导入模块: from tkinter import simpledialog [as 别名]
# 或者: from tkinter.simpledialog import askfloat [as 别名]
def adjProfile(self,proj):
        minPos = sd.askfloat("Input","Start x coordinate")
        if minPos is not None:
            maxPos = sd.askfloat("Input","End x coordinate")
            if maxPos is not None:
                proj.adjProfile(minPos=minPos,maxPos=maxPos)
                self.xrng=[minPos,maxPos] 
开发者ID:NSGeophysics,项目名称:GPRPy,代码行数:9,代码来源:gprpyCWGUI.py

示例15: setZeroTime

# 需要导入模块: from tkinter import simpledialog [as 别名]
# 或者: from tkinter.simpledialog import askfloat [as 别名]
def setZeroTime(self,proj):
        newZeroTime = sd.askfloat("Input","New zero time")
        if newZeroTime is not None:
            proj.setZeroTimeCW(newZeroTime=newZeroTime) 
开发者ID:NSGeophysics,项目名称:GPRPy,代码行数:6,代码来源:gprpyCWGUI.py


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