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

Python tkMessageBox.showerror函数代码示例

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

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



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

示例1: analysis

	def analysis(self):
		
		try:
			inputFile1 = self.filelocation1.get()
			window1 =  self.w1_type.get()
			M1 = int(self.M1.get())
			N1 = int(self.N1.get())
			t1 = int(self.t1.get())
			minSineDur1 = float(self.minSineDur1.get())
			minf01 = int(self.minf01.get())
			maxf01 = int(self.maxf01.get())
			f0et1 = int(self.f0et1.get())
			harmDevSlope1 = float(self.harmDevSlope1.get())
			
			nH = int(self.nH.get())
			stocf = float(self.stocf.get())
			
			inputFile2 = self.filelocation2.get()
			window2 =  self.w2_type.get()
			M2 = int(self.M2.get())
			N2 = int(self.N2.get())
			t2 = int(self.t2.get())
			minSineDur2 = float(self.minSineDur2.get())
			minf02 = int(self.minf02.get())
			maxf02 = int(self.maxf02.get())
			f0et2 = int(self.f0et2.get())
			harmDevSlope2 = float(self.harmDevSlope2.get())

			self.inputFile1, self.fs1, self.hfreq1, self.hmag1, self.stocEnv1, \
				self.inputFile2, self.hfreq2, self.hmag2, self.stocEnv2 = hM.analysis(inputFile1, window1, M1, N1, t1, \
				minSineDur1, nH, minf01, maxf01, f0et1, harmDevSlope1, stocf, inputFile2, window2, M2, N2, t2, minSineDur2, minf02, maxf02, f0et2, harmDevSlope2)

		except ValueError as errorMessage:
			tkMessageBox.showerror("Input values error", errorMessage)
开发者ID:2opremio,项目名称:sms-tools,代码行数:34,代码来源:hpsMorph_GUI_frame.py


示例2: Conv

	def Conv(self):										# 转换图片
		n = 0
		if self.mstatus.get():
			path = self.entryDir.get()
			if path == '':
				tkMessageBox.showerror('Python Tkinter','请输入路径')
				return
			filenames = os.listdir(path)
			if self.fstatus.get():
				f = self.Image.get()
				for filename in filenames:
					if filename[-3:] in ('bmp','jpg','gif','png'):
			       			self.make(path + '/' + filename, f)
						n = n + 1
			else:
				for filename in filenames:
					if filename[-3:] in ('bmp','jpg','gif','png'):
			       			self.make(path + '/' + filename)
						n = n + 1
		else:
			file = self.entryFile.get()
			if file == '':
				tkMessageBox.showerror('Python Tkinter','请选择文件')
				return
			if self.fstatus.get():
				f = self.Image.get()
				self.make(file, f)
				n = n + 1
			else:
				self.make(file)
				n = n + 1
		self.status.set('成功转换%d图片' % n)
开发者ID:Leoyuseu,项目名称:CodeHub,代码行数:32,代码来源:pyImageThumb.py


示例3: _load

 def _load():
     filename = askopenfilename(initialdir='accpy/exampledata/')
     if filename[-5::] != '.hdf5':
         filestr.set('error: {} is not hdf5 file-type'.format(filename))
         showerror('ERROR', 'THIS IS NOT A HDF5 FILE')
     else:
         filestr.set(filename)
开发者ID:kramerfelix,项目名称:accpy,代码行数:7,代码来源:measure.py


示例4: login

 def login(self, event=None):
     "Check the user's input and allow access if it is correct"""
     usernameGiven = self.userEntry.get()
     passwordGiven = self.passEntry.get()
     userDetails = self.db.sql("""SELECT * FROM
                               users WHERE username='%s'"""
                               %(usernameGiven.lower().strip()))
     #Check that the username exists
     if len(userDetails)==1:
         passHash = userDetails[0][2]
         #Check that the password is correct
         if (hashlib.sha1(passwordGiven).hexdigest() == passHash):
             #Details are correct, unlock application
             self.parent.login(User(userDetails[0]))
             loginFailed = False
         else:
             loginFailed = True
     else:
         loginFailed = True
     if loginFailed:
         #If details are incorrect show an error message
         tkMessageBox.showerror("Login Failed",
                                "Invalid username or password")
         self.userEntry.delete(0, END)
         self.passEntry.delete(0, END)
开发者ID:Soulreaverm,项目名称:SE206Project,代码行数:25,代码来源:LoginFrame.py


示例5: SaveGeneratedBarcode

def SaveGeneratedBarcode():
 GenerateBarcode();
 upc_validate = entry1.get();
 if(listboxtxt1.get()=="UPC-A" or listboxtxt1.get()=="UPC-E" or listboxtxt1.get()=="EAN-13" or listboxtxt1.get()=="EAN-8"):
  if(re.findall("([0-9]+)([ |\|]{1})([0-9]{2})$", entry1.get())):
   upc_pieces = re.findall("([0-9]+)([ |\|]{1})([0-9]{2})$", entry1.get());
   upc_pieces = upc_pieces[0];
   upc_validate = upc_pieces[0];
  if(re.findall("([0-9]+)([ |\|]){1}([0-9]{5})$", entry1.get())):
   upc_pieces = re.findall("([0-9]+)([ |\|]){1}([0-9]{5})$", entry1.get());
   upc_pieces = upc_pieces[0];
   upc_validate = upc_pieces[0];
 savestate = False;
 savefname = "";
 tmpbarcode = upcean.oopfuncs.barcode(barcode_list[listboxtxt1.get()], entry1.get());
 tmpbarcode.size = magnify.get();
 tmpbarcode.barheight = (int(entry2.get()),int(entry3.get()));
 tmpbarcode.barcolor = barcode_bar_color;
 tmpbarcode.textcolor = barcode_text_color;
 tmpbarcode.bgcolor = barcode_bg_color;
 savefname = ShowSaveDialog();
 tmpbarcode.filename = savefname;
 if(savefname!=""):
  savestate = tmpbarcode.validate_create_barcode();
 if(not savestate and savefname!=""):
  tkMessageBox.showerror("PyUPC-EAN - Error", "Failed to save barcode.");
开发者ID:brettatoms,项目名称:PyUPC-EAN,代码行数:26,代码来源:upc-ui.py


示例6: openXML

def openXML(mainApp, filename=''):
	if askSaveChanges(mainApp):
		label_filename = mainApp.frames.menu.dic['label_filename']
		if filename=='':
			filename = getFilename()
		
		if filename <> '':
			mainApp.frames.treeview.clean()
			mainApp.frames.buttons.clean()
			GL.filename = filename
			label_filename.config(text= GL.filename)
			
			root = xml_man.getXML(GL.filename)
			#root = xml_man.getXML('stylers.xml')
			
			if root == None:
				tkMessageBox.showerror('eXMLorer', 'El archivo %s no es un archivo XML valido' % GL.filename)
				label_filename.config(text= '')
			else:	
				GL.dicTagsInTree = {}
				GL.appTreeView = tk_treeview.getTreeView(mainApp.frames.treeview, mainApp.frames.buttons, GL.dicTagsInTree)
				
				GL.dicTagsInTree[root.tag] = TIG.TagInTree('', root.tag, root, None, GL.appTreeView)
				mainApp.rootTIG = GL.dicTagsInTree[root.tag]
				addXMLToTree(root, root.tag, GL.dicTagsInTree, GL.appTreeView)
开发者ID:YQS,项目名称:eXMLorer,代码行数:25,代码来源:tk_app.py


示例7: make_authorization

    def make_authorization(self):
        cashier_id, warehouse_id = workplace_authorization.get_workpace_data()
        #print cashier_id, warehouse_id
        success = True

        error_message = ""

        if None == cashier_id or None == warehouse_id or \
            "" == cashier_id or "" == warehouse_id:
            error_message = "Все указанные поля должны быть заполнены"
            success = False

        if success:
            try:
                res = cashier_workplace.authorization(cashier_id, warehouse_id)
            except Exception:
                res = False
                error_message = "Неверно заполнены поля авторизации"
            success = success and res
            if not res:
                error_message = "Вы не обладаете полномочиями для авторизации. " \
                                "Проверьте вводимые значение. А возможно, вы уже уволены"

        if success:

            self.auth_cashier_btn['command']     = self.make_logout
            self.auth_cashier_btn['text']        = "Деавторизация"
            self.compute_bonus_btn['state']      = 'normal'
            self.dismiss_cashier_btn['state']    = 'normal'
            self.get_goods_table_btn['state']    = 'normal'
            self.update_goods_info_btn['state']  = 'normal'
            self.change_cash_status_btn['state'] = 'normal'
        else:
            tkMessageBox.showerror("Ошибка авторизации", error_message)
        self.mainloop()
开发者ID:licht741,项目名称:workplace_cashier,代码行数:35,代码来源:workplace_gui.py


示例8: strip

def strip(root, amber_prmtop, messages):
   """ Strips a mask from the topology file """
   if amber_prmtop.parm.chamber:
      showerror('Not Implemented', 'The strip command does not yet work with ' +
                'chamber topologies')
      return
   # We need a mask, new radius, new epsilon, and for chamber topologies,
   # a new radius-1-4 and epsilon-1-4. Don't add the latter ones until we
   # know if we have a chamber prmtop or not.
   widget_list = [('MaskEntry', 'Atoms to strip from topology')]
   # We need 5 string variables, then get the description. 
   var_list = [StringVar()]
   description=('Strips the selected atoms from the topology file. All\n' +
                'remaining atoms and parameters remain unchanged. Any\n' +
                'parameters associated with stripped atoms are removed.')
   # Create the window, open it, then wait for it to close
   cmd_window = _guiwidgets.ActionWindow('addLJType', amber_prmtop,
                     widget_list, var_list, description)
   cmd_window.wait_window()
   # See if we got any variables back
   var = var_list[0]
   if not var.get(): return
   try:
      action = ParmedActions.strip(amber_prmtop, ArgumentList(var.get()))
   except Exception, err:
      showerror('Unexpected Error!', '%s: %s' % (type(err).__name__, err))
      return
开发者ID:zhangxiaoyu11,项目名称:mAMBER,代码行数:27,代码来源:_guiactions.py


示例9: addexclusions

def addexclusions(root, amber_prmtop, messages):
   """ Adds atoms to other atoms' exclusion list """
   # We need 2 masks
   widget_list = [('MaskEntry', 'Atoms to add excluded atoms to'),
                  ('MaskEntry', 'Atoms to exclude from other mask')]
   # We have 2 mask variables
   var_list = [StringVar(), StringVar()]
   # Description
   description=('Allows you to add arbitrary excluded atoms to exclusion\n' +
       'lists. This omits all non-bonded interactions in the direct-space\n' +
       'calculation, but does not omit interactions from adjacent cells in\n' +
       'periodic simulations')
   cmd_window = _guiwidgets.ActionWindow('addExclusions', amber_prmtop,
                     widget_list, var_list, description)
   cmd_window.wait_window()
   
   # Bail out if we didn't get any variables
   if not True in [bool(v.get()) for v in var_list]: return
   
   var_list = [v.get() for v in var_list]
   try:
      action = ParmedActions.addexclusions(amber_prmtop, ArgumentList(var_list))
   except Exception, err:
      showerror('Unexpected Error!', '%s: %s' % (type(err).__name__, err))
      return
开发者ID:zhangxiaoyu11,项目名称:mAMBER,代码行数:25,代码来源:_guiactions.py


示例10: change

def change(root, amber_prmtop, messages):
   """ Allows us to change a specific atomic property """
   # The spinbox is sent with the Spinbox, label, and then a list of all of the
   # values to give to it
   widget_list = [('Spinbox', 'Property to change', 'CHARGE', 'MASS',
                   'RADII', 'SCREEN', 'ATOM_NAME', 'AMBER_ATOM_TYPE',
                   'ATOM_TYPE_INDEX', 'ATOMIC_NUMBER'),
                  ('MaskEntry', 'Atoms to change'),
                  ('Entry', 'New Value for Property')]
   # We need 3 string variables, then get the description
   var_list = [StringVar(), StringVar(), StringVar()]
   description = 'Changes the property of given atoms to a new value'
   # Create the window, open it, then wait for it to close
   cmd_window = _guiwidgets.ActionWindow('change', amber_prmtop,
                     widget_list, var_list, description)
   cmd_window.wait_window()
   # See if we got any variables back
   vars_found = True in [bool(v.get()) for v in var_list]
   if not vars_found: return
   # If we did, store them and pass it to the class
   var_list = [v.get() for v in var_list]
   try:
      action = ParmedActions.change(amber_prmtop, ArgumentList(var_list))
   except Exception, err:
      showerror('Unexpected Error!', '%s: %s' % (type(err).__name__, err))
      return
开发者ID:zhangxiaoyu11,项目名称:mAMBER,代码行数:26,代码来源:_guiactions.py


示例11: printinfo

def printinfo(root, amber_prmtop, messages):
   """ Prints all of the info in a given FLAG """
   # Set up the window
   # variables we need for printInfo
   widget_list = [('Entry', '%FLAG you want info from')]
   # Variable list -- we need a single string
   var_list = [StringVar()]
   # description
   description = ' '.join(ParmedActions.printinfo.__doc__.split())
   cmd_window = _guiwidgets.ActionWindow('printInfo', amber_prmtop,
                             widget_list, var_list, description)
   cmd_window.wait_window()
   # Make sure we didn't cancel (or just press OK with no input), or just leave
   var = var_list[0].get()
   if not var: return
   # Now that we did something, do it
   action = ParmedActions.printinfo(amber_prmtop, ArgumentList(var))
   if not action.found:
      showerror('Not Found!', '%%FLAG %s not found!' % var.upper())
      return

   window = Toplevel(root)
   window.resizable(True, True)
   window.title('%%FLAG %s Info in %s' % (var.upper(), amber_prmtop))
   text = _guiwidgets.ExitingScrollText(window, None, spacing3=5, padx=5,
                                        pady=5, width=82, height=20)
   text.write(action)
   text.pack(fill=BOTH, expand=1)
   window.wait_window()

   messages.write('Wrote info for flag %s\n' % var.upper())
开发者ID:zhangxiaoyu11,项目名称:mAMBER,代码行数:31,代码来源:_guiactions.py


示例12: changelj14pair

def changelj14pair(root, amber_prmtop, messages):
   """ Changes specific 1-4 Lennard Jones pairs """
   # Only good for chamber topologies
   if not amber_prmtop.parm.chamber:
      showerror('Incompatible',
                'changeLJ14Pair is only valid for chamber topologies!')
      return
   # variables we need for changelj14pair
   widget_list = [('MaskEntry', 'Atom(s) Type 1 Mask'),
                  ('MaskEntry', 'Atom(s) Type 2 Mask'),
                  ('Entry', 'Combined Radius'),
                  ('Entry', 'Combined Well Depth')]
   # Variable list -- we need 2 masks and 2 floats
   var_list = [StringVar(), StringVar(), StringVar(), StringVar()]
   # description
   description = ' '.join(ParmedActions.changeljpair.__doc__.split())
   cmd_window = _guiwidgets.ActionWindow('changeLJ14Pair', amber_prmtop,
                             widget_list, var_list, description)
   cmd_window.wait_window()
   # Make sure we didn't cancel (or just press OK with no input), or just leave
   vars_exist = True in [bool(v.get()) for v in var_list]
   if not vars_exist: return
   # Now that we did something, do it
   var_list = [v.get() for v in var_list]
   try:
      action=ParmedActions.changelj14pair(amber_prmtop, ArgumentList(var_list))
      messages.write('%s\n' % action)
      action.execute()
   except Exception, err:
      showerror('Unexpected Error!', '%s: %s' % (type(err).__name__, err))
开发者ID:zhangxiaoyu11,项目名称:mAMBER,代码行数:30,代码来源:_guiactions.py


示例13: plot_graph

	def plot_graph(self):
		self.pattern=re.compile(".*\.(xlsx|ods)")
		self.match = self.pattern.match(self.filename)
		if not self.match or self.filename is None:
        		tkMessageBox.showerror(title="Wrong Input",message="Invalid File Type")
			exit()

		self.wb=xlrd.open_workbook(self.filename)
		s=self.wb.sheet_by_index(0)
		top = Toplevel()
		self.varx=IntVar()
		self.vary=IntVar()
		top.title("Configuration")

		w=Label(top,text=str(s.ncols)+" columns found")
		w.pack()
		x=Label(top,text="Assign column to the x-axis")
		x.pack()
		for i in range(s.ncols):
			c=Radiobutton(top, text="Column "+str(i+1),variable=self.varx, value=i)
        		c.pack(anchor=W)
        	y=Label(top,text="Assign column to the y-axis")
        	y.pack()
        	for i in range(s.ncols):
        		d=Radiobutton(top,text="Column "+str(i+1),variable=self.vary,value=i)
        		d.pack(anchor=W)
		self.plott=Button(top,text="Plot Graph",command=self.sweg).pack()	
开发者ID:LuckysonKhaidem,项目名称:statlab,代码行数:27,代码来源:stat1.py


示例14: add_customer

 def add_customer(self, event=None):
     # validate and show errors
     if self.fname.get() == '':
         showerror("Error!", "First name field blank!")
     elif self.lname.get() == '':
         showerror("Error!", "Last name field blank!")
     elif self.mname.get() == '':
         showerror("Error!", "Middle initial field blank!")
     elif self.payment.get() not in ("Drop In", "Punch Card", "Monthly", "Inactive"):
         showerror("Error!", "Incorect Customer type!")
     elif not re.compile(r'[01]?\d/[0123]?\d/[12]\d{1,3}').search(self.date.get()):
         showerror("Error!", "Bad entry for date, use format mm/dd/yyyy")
     else:
         # do work
         name = ' '.join([self.fname.get(),self.mname.get(),self.lname.get()])
         old, row = self.customers.find(str(self.lname.get()).strip(), str(self.fname.get()).strip(),
                                        str(self.mname.get()).strip())
         new = [str(self.lname.get()).strip(), str(self.fname.get()).strip(), str(self.mname.get()).strip(),
                str(self.payment.get()).strip(), datetime.strptime(self.date.get(), "%m/%d/%Y")]
         
         if not old: #add customer
             self.customers.add(new)
             self.output_text("+ - New Customer: " + name + " (" + self.payment.get() + ")\n")
             self.refresh()
         else:
             var = IntVar()
             
             diag = AlreadyExistsDialog(self.root, new, old, var)
             diag.show()
             if var.get() == 0: # edit
                 pass
             if var.get() == 1: # replace customer
                 self.customers.replace(row, new)
                 self.output_text("+ - Modified: " + name + " (" + self.payment.get() + ")\n")
                 self.refresh()
开发者ID:tylerjw,项目名称:jim_tracker,代码行数:35,代码来源:customer.py


示例15: __plist2Excel__

 def __plist2Excel__(self):
     
     if self.outEntry.get() == "" or self.plistEntry.get() == "":
         tkMessageBox.showerror('Result',"input res or plist res is requested!")
         return
     info = self.scanPlist.scanPlistDir(self.outEntry.get(),self.plistEntry.get())
     tkMessageBox.showinfo('Result',info)      
开发者ID:xbinglzh,项目名称:PythonTools,代码行数:7,代码来源:PyQt.py


示例16: changeljsingletype

def changeljsingletype(root, amber_prmtop, messages):
   """ Changes radius/well depth of a single LJ type given by the mask """
   # We need a mask, radius, and well depth
   widget_list = [('MaskEntry', 'Mask to change LJ Type'),
                  ('Entry', 'New LJ Radius'), ('Entry', 'New LJ Depth')]
   var_list = [StringVar(), StringVar(), StringVar()]
   description = "Change a given atom type's LJ radius and well depth"
   # Create the window, open it, then wait for it to close
   cmd_window = _guiwidgets.ActionWindow('changeLJSingleType', amber_prmtop,
                     widget_list, var_list, description)
   cmd_window.wait_window()
   # See if we got any variables back
   vars_found = True in [bool(v.get()) for v in var_list]
   if not vars_found: return
   # addljtype expects any _non_specified variables to be None
   var_list = [v.get() for v in var_list]
   for i, v in enumerate(var_list):
      if not v: var_list[i] = None
   # If we did, store them and pass it to the class
   try:
      action = ParmedActions.changeljsingletype(amber_prmtop,
                                                ArgumentList(var_list))
   except Exception, err:
      showerror('Unexpected Error!', '%s: %s' % (type(err).__name__, err))
      return
开发者ID:zhangxiaoyu11,项目名称:mAMBER,代码行数:25,代码来源:_guiactions.py


示例17: runMission

    def runMission( self, mission_spec, mission_record_spec, action_space ):
        '''Sets a mission running.
        
        Parameters:
        mission_spec : MissionSpec instance, specifying the mission.
        mission_record_spec : MissionRecordSpec instance, specifying what should be recorded.
        action_space : string, either 'continuous' or 'discrete' that says which commands to generate.
        '''
        sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)  # flush print output immediately
        self.world_state = None
        self.action_space = action_space
        total_reward = 0

        if mission_spec.isVideoRequested(0):
            self.canvas.config( width=mission_spec.getVideoWidth(0), height=mission_spec.getVideoHeight(0) )

        try:
            self.agent_host.startMission( mission_spec, mission_record_spec )
        except RuntimeError as e:
            tkMessageBox.showerror("Error","Error starting mission: "+str(e))
            return

        print "Waiting for the mission to start",
        self.world_state = self.agent_host.peekWorldState()
        while not self.world_state.is_mission_running:
            sys.stdout.write(".")
            time.sleep(0.1)
            self.world_state = self.agent_host.peekWorldState()
            for error in self.world_state.errors:
                print "Error:",error.text
        print
        if mission_spec.isVideoRequested(0) and action_space == 'continuous':
            self.canvas.config(cursor='none') # hide the mouse cursor while over the canvas
            self.canvas.event_generate('<Motion>', warp=True, x=self.canvas.winfo_width()/2, y=self.canvas.winfo_height()/2) # put cursor at center
            self.root.after(50, self.update)
        self.canvas.focus_set()

        while self.world_state.is_mission_running:
            self.world_state = self.agent_host.getWorldState()
            if self.world_state.number_of_observations_since_last_state > 0:
                self.observation.config(text = self.world_state.observations[0].text )
            if mission_spec.isVideoRequested(0) and self.world_state.number_of_video_frames_since_last_state > 0:
                frame = self.world_state.video_frames[-1]
                image = Image.frombytes('RGB', (frame.width,frame.height), str(frame.pixels) )
                photo = ImageTk.PhotoImage(image)
                self.canvas.delete("all")
                self.canvas.create_image(frame.width/2, frame.height/2, image=photo)
                self.canvas.create_line( frame.width/2 - 5, frame.height/2, frame.width/2 + 6, frame.height/2, fill='white' )
                self.canvas.create_line( frame.width/2, frame.height/2 - 5, frame.width/2, frame.height/2 + 6, fill='white' )
                self.root.update()
            for reward in self.world_state.rewards:
                total_reward += reward.getValue()
            self.reward.config(text = str(total_reward) )
            time.sleep(0.01)
        if mission_spec.isVideoRequested(0) and action_space == 'continuous':
            self.canvas.config(cursor='arrow') # restore the mouse cursor
        print 'Mission stopped'
        if not self.agent_host.receivedArgument("test"):
            tkMessageBox.showinfo("Ended","Mission has ended. Total reward: " + str(total_reward) )
        self.root.destroy()
开发者ID:hjl,项目名称:malmo,代码行数:60,代码来源:human_action.py


示例18: changeljpair

def changeljpair(root, amber_prmtop, messages):
   """ Changes a pair-wise LJ interaction for pre-combined epsilon/Rmin """
   # The variables we need for changeljpair
   widget_list = [('MaskEntry', 'Atom(s) Type 1 Mask'),
                  ('MaskEntry', 'Atom(s) Type 2 Mask'),
                  ('Entry', 'Combined Radius'),
                  ('Entry', 'Combined Well Depth')]
   # Variable list -- we need 2 masks and 2 floats
   var_list = [StringVar(), StringVar(), StringVar(), StringVar()]
   # description
   description = ' '.join(ParmedActions.changeljpair.__doc__.split())
   cmd_window = _guiwidgets.ActionWindow('changeLJPair', amber_prmtop,
                             widget_list, var_list, description)
   cmd_window.wait_window()
   # Make sure we didn't cancel (or just press OK with no input), or just leave
   vars_exist = True in [bool(v.get()) for v in var_list]
   if not vars_exist: return
   # Now that we did something, do it
   var_list = [v.get() for v in var_list]
   try:
      action = ParmedActions.changeljpair(amber_prmtop, ArgumentList(var_list))
      messages.write('%s\n' % action)
      action.execute()
   except Exception, err:
      showerror('Unexpected Error!', '%s: %s' % (type(err).__name__, err))
开发者ID:zhangxiaoyu11,项目名称:mAMBER,代码行数:25,代码来源:_guiactions.py


示例19: add_music

def add_music(dic, item_name, item_url,entery, defult):
    if item_name not in dic.keys():
        dic[item_name] = item_url
        entery.delete(0, END)
        entery.insert(0, defult)
    else:
        tkMessageBox.showerror("error", item_name+" is already in the list ")
开发者ID:ofer515,项目名称:project,代码行数:7,代码来源:start.py


示例20: setangle

def setangle(root, amber_prmtop, messages):
   """ Sets (adds or changes) an angle in the topology file """
   # We need 3 masks, a force constant, and an equilibrium angle
   widget_list = [('MaskEntry', 'First atom in angle'),
                  ('MaskEntry', 'Second (middle) atom in angle'),
                  ('MaskEntry', 'Third atom in angle'),
                  ('Entry', 'Force constant (kcal/mol rad**2)'),
                  ('Entry', 'Equilibrium Angle (Degrees)')]
   # We need 5 variables
   var_list = [StringVar(), StringVar(), StringVar(), StringVar(), StringVar()]
   description = ('Sets an angle in the topology file with the given Force ' +
                  'constant in kcal/mol/rad**2\nand the given equilibrium ' +
                  'angle in Degrees. All three masks must specify only a\n' +
                  'single atom. If the angle exists, it will be replaced. If ' +
                  'it doesn\'t, it will be added.')
   # Create the window, open it, then wait for it to close
   cmd_window = _guiwidgets.ActionWindow('setAngle', amber_prmtop, 
                     widget_list, var_list, description)
   cmd_window.wait_window()
   # See if we got any variables back
   vars_found = True in [bool(v.get()) for v in var_list]
   if not vars_found: return
   # If we did, pass them through
   var_list = [v.get() for v in var_list]
   try:
      action = ParmedActions.setangle(amber_prmtop, ArgumentList(var_list))
      messages.write('%s\n' % action)
      action.execute()
   except Exception, err:
      showerror('Unexpected Error!', '%s: %s' % (type(err).__name__, err))
      return
开发者ID:zhangxiaoyu11,项目名称:mAMBER,代码行数:31,代码来源:_guiactions.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python tkMessageBox.showinfo函数代码示例发布时间:2022-05-27
下一篇:
Python tkMessageBox.askyesno函数代码示例发布时间: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