本文整理汇总了Python中tkMessageBox.showinfo函数的典型用法代码示例。如果您正苦于以下问题:Python showinfo函数的具体用法?Python showinfo怎么用?Python showinfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showinfo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
示例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)
示例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
示例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")
示例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
示例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.")
示例7: file_save1
def file_save1(event=None):
try:
savetex()
except Cancel:
pass
tkMessageBox.showinfo(title="saving tex file", message ="saved!!! :D")
return "break"
示例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()
示例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"
示例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)
示例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)
示例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)
示例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
示例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
示例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)