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

Python tkMessageBox.showinfo函数代码示例

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

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



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

示例1: ExportSecretaris

def ExportSecretaris():

    # Obrim el fitxer de text
    # Així es com estava abans quan el ficava a /exportacions ----> f=open("exportacions/secretaris-ajuntaments.txt","w")
    fitxer = tkFileDialog.asksaveasfilename(
        defaultextension="*.txt|*.*", filetypes=[("Fitxer TXT", "*.txt"), ("Tots els fitxers", "*.*")]
    )
    f = open(fitxer, "w")

    # Generamos el select para obtener los datos de la ficha

    db = MySQLdb.connect(host=SERVIDOR, user=USUARI, port=4406, passwd=CONTRASENYA, db=BASE_DE_DADES)
    cursor = db.cursor()
    sql = "SELECT MUNICIPIO, SECRETARIO FROM ayuntamientos ORDER BY MUNICIPIO"
    cursor.execute(sql)
    resultado = cursor.fetchall()

    for i in resultado:
        f.write(str(i[0]) + " - " + str(i[1]) + "\n")

        # tanquem el fitxer

    f.close()

    if len(fitxer) > 0:
        tkMessageBox.showinfo("TXT Generat", "S'ha generat la fitxa amb els secretaris a " + fitxer)
    else:
        return
开发者ID:joancatala,项目名称:pyApps,代码行数:28,代码来源:pyGestioAjuntaments.py


示例2: Suma

def Suma():
   n1=float(caja1.get())
   n2=float(caja2.get())
   suma=n1+n2
   tkMessageBox.showinfo("Mensaje","El resultado es: %.2f"%suma)
   caja1.delete(0,20)
   caja2.delete(0,20)
开发者ID:EnriqueV,项目名称:Scripts-Python,代码行数:7,代码来源:grafico.py


示例3: __getCycleRootsManually

def __getCycleRootsManually(cycleNodes):
  """
  Allows the user to break cycles by clicking no nodes to choose tree roots
  Returns the final rootNodes (ie: including those that break cycles)
  """
  if(len(cycleNodes) > 0):
    showinfo('TreeLikeLayout: Cycle/s Detected', 
             'Manual cycle breaking mode in effect\n\n'
              + 'Cyclic nodes will be highlighted\n\n'
              + 'Please break the cycle/s by clicking on the node/s'
              + ' you want as tree root/s')
  rootNodes = []
  while(len(cycleNodes) > 0):
        
    index = cycleNodes[0].chooseNode(cycleNodes)
    if(index != None):
      chosenRootNode = cycleNodes[index]
      chosenRootNode._treeVisit = True
      rootNodes.append(chosenRootNode) 
      __markChildrenNodesBFS(chosenRootNode, [])
    # Cleanup: leave only nodes that still form a cycle
    temp = cycleNodes[:]
    for node in temp:
      if(node._treeVisit == True):
        cycleNodes.remove(node)
        
  return rootNodes
开发者ID:pombreda,项目名称:comp304,代码行数:27,代码来源:TreeLikeLayout.py


示例4: about_message

def about_message():
    """
    Shows the about message box popup of the GUI
    """
    tkMessageBox.showinfo("About", "Welcome to the Automatic Desktop Sorting Application\
    \nBy EasyTech\nContact @ [email protected]\
    \nVersion 1.0")
开发者ID:iamnaf,项目名称:Desktop-Sorting-Application-Python-Tkinter,代码行数:7,代码来源:main.py


示例5: drawError

 def drawError(self,errormsg=""):
     """ Draw a error message dialog
     @type  errormsg: string
     @param errormsg: the messag to display
     """  
     messagebox.showinfo("Error",errormsg)
     return
开发者ID:gj210,项目名称:upy,代码行数:7,代码来源:dejavuUI.py


示例6: onShow

 def onShow(self):
     if os.path.exists(reminderFilePath):
         self.createWindow()
         self.clear()
     else:
         print("The file doesn't exist!")
         box.showinfo("Information", "The file either doesnt exist or can't be found, plese enter a new reminder to create a file.")
开发者ID:callumjm97,项目名称:Popup-Reminder-GUI,代码行数:7,代码来源:PopupReminderGUI.py


示例7: file_save1

def file_save1(event=None):
    try:
        savetex()
    except Cancel:
        pass
	tkMessageBox.showinfo(title="saving tex file", message ="saved!!! :D")
    return "break"
开发者ID:aviisekh,项目名称:md2tex,代码行数:7,代码来源:gui.py


示例8: send

	def send(self):
		import httplib, urllib
		global errors
		email = self.email.get()
		desc  = self.text.get('1.0', END).strip()

		# Send information
		self.config(cursor="watch")
		self.text.config(cursor="watch")
		self.update_idletasks()
		params = urllib.urlencode({"email":email, "desc":desc})
		headers = {"Content-type": "application/x-www-form-urlencoded",
			"Accept": "text/plain"}
		conn = httplib.HTTPConnection("www.fluka.org:80")
		try:
			conn.request("POST", "/flair/send_email_bcnc.php", params, headers)
			response = conn.getresponse()
		except:
			tkMessageBox.showwarning(_("Error sending report"),
				_("There was a problem connecting to the web site"),
				parent=self)
		else:
			if response.status == 200:
				tkMessageBox.showinfo(_("Report successfully send"),
					_("Report was successfully uploaded to web site"),
					parent=self)
				del errors[:]
			else:
				tkMessageBox.showwarning(_("Error sending report"),
					_("There was an error sending the report\nCode=%d %s")%\
					(response.status, response.reason),
					parent=self)
		conn.close()
		self.config(cursor="")
		self.cancel()
开发者ID:moacirbmn,项目名称:bCNC,代码行数:35,代码来源:Utils.py


示例9: backupdata

    def backupdata(self):
        print "You requested the backup routine"
        self.option_add('*font', 'Helvetica -14')
        self.option_add("*Dialog.msg.wrapLength", "10i")

        # Check to see if the directories were set for something else
        if self.varSource.get() == "SourceDir" :
            tkMessageBox.showwarning("Warning!",  "First set the source directory!")
        elif self.varDestination.get() == "DestinationDir" :
            tkMessageBox.showwarning("Warning!",  "Also remember to set the  destination directory!")
        # OK good to go
        else:
            result = tkMessageBox.askyesno("Ready to backup!!",
                                           "You will now synchronize your folder\n\n%s\n\ninto your backup folder:\n\n%s"
                                           %(os.path.basename(self.varSource.get()),self.varDestination.get()))
            if result :
                print "You have accepted to backup"
                self.DiskUsage = Tkinter.StringVar()
                DiskUsage = os.popen('du -hs "%s"'%(self.varSource.get())).read()
                tkMessageBox.showinfo("First notification",
                                      "Your job size is :\n"
                                      +DiskUsage+
                                      "\n this could take a while, please be patient.")
                var_rsync_command = subprocess.Popen(["rsync", "-ahv", self.varSource.get(), self.varDestination.get()], stdout=subprocess.PIPE)
                # Trying to make the textbox update all the time
                for line in iter(var_rsync_command.stdout.readline,''):
                    self.var_textbox.insert(Tkinter.END, line)
                    self.var_textbox.update()
                    self.var_textbox.yview(Tkinter.END)
                #
                tkMessageBox.showinfo("Backup complete","The rsync job has finished")

            else:
                print "You declined to backup your data"
开发者ID:folf,项目名称:MaxSync,代码行数:34,代码来源:MaxSync.py


示例10: __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


示例11: on_run

    def on_run(self):
        target_dir = self.target_dir.get().decode(sys.getfilesystemencoding())
        if len(target_dir) == 0:
            tkMessageBox.showinfo(title="No target directory",
                                  message="No target directory selected.")
            return
        input_paths = self.input_dirs.get(0, Tkinter.END)
        input_paths = [ip.decode(sys.getfilesystemencoding())
                       for ip in input_paths]
        no_length_patch = bool(self.skip_ogg_patch.get())

        # Disable GUI
        self.disable()

        logger = ThreadQueueLogger()

        # To avoid locking the GUI, run execution in another thread.
        thread = threading.Thread(
            target=r21buddy.run,
            args=(target_dir, input_paths),
            kwargs={"length_patch": (not no_length_patch), "verbose": True,
                    "ext_logger": logger})
        thread.start()

        # Initiate a polling function which will update until the
        # thread finishes.
        self._on_run(thread, logger)
开发者ID:Vultaire,项目名称:r21buddy,代码行数:27,代码来源:r21buddy_gui.py


示例12: __excel2Plist__

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


示例13: dex

def dex():
	try:
		t1=t1_text.get()
		t2=t2_text.get()
		t3=t3_text.get()
		t4=t4_text.get()
		a1=float(t1)
		a2=float(t2)
		a3=float(t3)
		a4=float(t4)
#		num=a1+(float(a2)-1)*a3
#		sum=(a1+num)/2*a2
		sum=(a2-a1)*a3-10-a2*a3*a4/10000
		string=str("您目前的盈亏为 %f" % sum)
		print "您目前的盈亏为 %f" % sum
		tkMessageBox.showinfo(title='结果',message=string)
		
		try:
			save=MySQLdb.connect(host='rm-bp12a3q2p8q14i0yk.mysql.rds.aliyuncs.com',user='re5sh0bjj8',passwd='Mysqlweb20',db='re5sh0bjj8')
			#save.query("grant all on *.* to 'root'@'10.2.48.100' identified by 'mysql'")
		except Exception,e:
			print e
			sys.exit()
	
		cursor=save.cursor()
		
		action="insert into stock(b_price,s_price,num,rate,profit) values (%f,%f,%f,%f,%f)" % (a1,a2,a3,a4,sum)
		try:
			cursor.execute(action)
		except Exception,e:
			print e
开发者ID:playboysnow,项目名称:python-,代码行数:31,代码来源:aliyun.py


示例14: genInitialInfo

def genInitialInfo():
    db = 'initialphoto.sqlite'
    sql_connection = sql.Connection(db)     # This is the path to the database. If it doesn't exist, it will be created, though, of course, without the require tables
    cursor = sql.Cursor(sql_connection)
    mainDB = openFile('Locate Main Database File', 'Spatialite SQL Database', 'sqlite')




    mainImages = openFolder('Find Main Images Library Folder')
           

    icons = openFolder('Find Icons Folder')
    srid = tkSimpleDialog.askstring('Spatial Reference System', 'Please provide a spatial reference ID (SRID).\nRefer to spatialreference.org for more instructions')

    sql_connection = sql.Connection(db)     # This is the path to the database. If it doesn't exist, it will be created, though, of course, without the require tables
    cursor = sql.Cursor(sql_connection)    
    try:
        createsql = "CREATE TABLE INITIATION ('mainImages' text,'maindb' text,'icons' text, 'srid' text)"
        cursor.execute(createsql)
    except:
        pass
    insertsql = "INSERT INTO INITIATION VALUES ('{0}','{1}','{2}','{3}')".format(mainImages, mainDB,icons, srid)
    cursor.execute(insertsql)
    sql_connection.commit()
    tkMessageBox.showinfo('Database Initialized', 'Your settings have been recorded')
    standards = mainImages,  mainDB, icons,srid 
    return standards
开发者ID:geolibrerian,项目名称:simplegis,代码行数:28,代码来源:INITIATE_FieldViewerFull.py


示例15: main

def main():
    Tk().withdraw()
    tkMessageBox.showinfo( "Image", "Select an Image")
    usrImag = askopenfilename()
    thres=Threshold(Image.open(str(usrImag)))
    value =int(raw_input("Give me the threshold value"))
    thres.threshold(value)
开发者ID:JEpifanio90,项目名称:LabVision-Python,代码行数:7,代码来源:Threshold.py


示例16: 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


示例17: __drawRiversHandler

 def __drawRiversHandler():
     if self.layer2==0:
         shpFile = tkFileDialog.askopenfilename(parent=self.root, initialdir=".", title='Please select a shpfile', defaultextension='.shp', filetypes=(("shp file", "*.shp"),("all files", "*.*")))
         self.addLayer(shpFile,"blue")
         self.layer2 = 1
     else:
         tkMessageBox.showinfo("NOTE", "Please clean the canvas if you want to reload layer 2")
开发者ID:czhgorg,项目名称:GGS650,代码行数:7,代码来源:Windows.py


示例18: deleteLastCommandInQueue

	def deleteLastCommandInQueue(self):
		if self.command_line_num > 1:
			self.deleteLastCommandFromTextField()
			self.commandArray.pop()
		else:
			tkMessageBox.showinfo("Error", "Number of instructions is already 0, cannot delete")
		return
开发者ID:joemeneses,项目名称:eweek_2013,代码行数:7,代码来源:e_week_GUI.py


示例19: mail

  def mail(self):
    if(self.guideFile==""):
      tkMessageBox.showinfo("Error", "Please select guidelines file")
    else:
      self.msg = MIMEMultipart()
      self.msg['Subject'] = 'Important: Exam Guiedlines'
      self.msg['From'] = '[email protected]'
      #msg['Reply-to'] = '[email protected]'
      self.msg['To'] = '[email protected]'
 
      # That is what u see if dont have an email reader:
      self.msg.preamble = 'Multipart massage.\n'
 
      # This is the textual part:
      self.part = MIMEText("Please find attched guidelines for exams.")
      self.msg.attach(self.part)
 
      # This is the binary part(The Attachment):
      self.part = MIMEApplication(open(self.guideFile,'rb').read())
      self.part.add_header('Content-Disposition', 'attachment', filename=self.guideFile)
      self.msg.attach(self.part)
 
      # Create an instance in SMTP server
      self.server = SMTP("smtp.gmail.com",587)
      # Start the server:
      self.server.ehlo()
      self.server.starttls()
      self.server.login("[email protected]", "exammanage")
 
    # Send the email
      self.server.sendmail(self.msg['From'], self.msg['To'], self.msg.as_string())
      tkMessageBox.showinfo("Success", "Guidelines have been successfully mailed.")
      self.dest1()
开发者ID:paliwalvijay,项目名称:EMS01,代码行数:33,代码来源:home.py


示例20: handleCmd1

 def handleCmd1(self):       
     str =  ('Left Mouse Button:      Translate\n')
     str += ('Middle Mouse Button:  Rotate\n')
     str += ('Right Mouse Button:    Zoom\n')
    #str += ('Ctrl + H:                      Show/Hide Axes \n')
     
     tkMessageBox.showinfo(title='Controls', message=str)
开发者ID:SidSTi,项目名称:School-Projects,代码行数:7,代码来源:cLuster_new.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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