本文整理汇总了Python中form.Form.onSubmit方法的典型用法代码示例。如果您正苦于以下问题:Python Form.onSubmit方法的具体用法?Python Form.onSubmit怎么用?Python Form.onSubmit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类form.Form
的用法示例。
在下文中一共展示了Form.onSubmit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onSubmit
# 需要导入模块: from form import Form [as 别名]
# 或者: from form.Form import onSubmit [as 别名]
def onSubmit(self):
Form.onSubmit(self)
localdir = self.content['Local Dir?'].get()
portnumber = self.content['Port Number'].get()
servername = self.content['Server Name'].get()
filename = self.content['File Name'].get()
if localdir:
os.chdir(localdir)
portnumber = int(portnumber)
getfile.client(servername, portnumber, filename)
showinfo('getfilegui', 'Download complete')
if self.oneshot: Tk().quit() # else stay in last localdir
示例2: onSubmit
# 需要导入模块: from form import Form [as 别名]
# 或者: from form.Form import onSubmit [as 别名]
def onSubmit(self):
Form.onSubmit(self)
localdir = self.content["Local Dir?"].get()
portnumber = self.content["Port Number"].get()
servername = self.content["Server Name"].get()
filename = self.content["File Name"].get()
if localdir:
os.chdir(localdir)
portnumber = int(portnumber)
getfile.client(servername, portnumber, filename)
showinfo("getfilegui", "Download complete")
if self.oneshot:
Tk().quit() # else stay in last localdir
示例3: onSubmit
# 需要导入模块: from form import Form [as 别名]
# 或者: from form.Form import onSubmit [as 别名]
def onSubmit(self):
Form.onSubmit(self)
localdir = self.content['Local Dir'].get()
remotedir = self.content['Remote Dir'].get()
servername = self.content['Server Name'].get()
filename = self.content['File Name'].get()
username = self.content['User Name?'].get()
password = self.content['Password?'].get()
userinfo = ()
if username and password:
userinfo = (username, password)
if localdir:
os.chdir(localdir)
self.mutex.acquire()
self.threads +=1
self.mutex.release()
ftpargs = (filename, servername, remotedir, userinfo)
_thread.start_new_thread(self.transfer, ftpargs)
showinfo(self.title, '%s of "%s" started' % (self.mode, filename))