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

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

示例1: find

​点赞 6

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def find(self, text_to_find):

length = tk.IntVar()

idx = self.search(text_to_find, self.find_search_starting_index, stopindex=tk.END, count=length)

if idx:

self.tag_remove('find_match', 1.0, tk.END)

end = f'{idx}+{length.get()}c'

self.tag_add('find_match', idx, end)

self.see(idx)

self.find_search_starting_index = end

self.find_match_index = idx

else:

if self.find_match_index != 1.0:

if msg.askyesno("No more results", "No further matches. Repeat from the beginning?"):

self.find_search_starting_index = 1.0

self.find_match_index = None

return self.find(text_to_find)

else:

msg.showinfo("No Matches", "No matching text found")

开发者ID:PacktPublishing,项目名称:Tkinter-GUI-Programming-by-Example,代码行数:23,

示例2: success

​点赞 6

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def success(sb2path, warnings, gui):

if gui:

if warnings == 0:

messagebox.showinfo("Success", "Completed with no warnings")

elif warnings == 1:

messagebox.showinfo("Success", "Completed with {} warning".format(warnings))

else:

messagebox.showinfo("Success", "Completed with {} warnings".format(warnings))

else:

print('')

if warnings == 0:

print("Saved to '{}' with no warnings".format(sb2path))

elif warnings == 1:

print("Saved to '{}' with {} warning".format(sb2path, warnings))

else:

print("Saved to '{}' with {} warnings".format(sb2path, warnings))

开发者ID:RexScratch,项目名称:sb3tosb2,代码行数:18,

示例3: check_queue

​点赞 6

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def check_queue(self, queue):

if not queue.empty():

item = queue.get()

if item.status == 'done':

messagebox.showinfo(

item.status,

message=item.subject,

detail=item.body

)

self.status.set(item.subject)

return

elif item.status == 'error':

messagebox.showerror(

item.status,

message=item.subject,

detail=item.body

)

self.status.set(item.subject)

return

else:

self.status.set(item.body)

self.after(100, self.check_queue, queue)

开发者ID:PacktPublishing,项目名称:Python-GUI-Programming-with-Tkinter,代码行数:24,

示例4: info

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def info(message, title="信息"):

msgbox.showinfo(title=title, message=message)

开发者ID:winkidney,项目名称:PickTrue,代码行数:4,

示例5: info

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def info(subject, text):

messagebox.showinfo(subject, text)

开发者ID:pabloibiza,项目名称:WiCC,代码行数:4,

示例6: add_friend

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def add_friend(self, username):

if self.requester.add_friend(self.username, username):

msg.showinfo("Friend Added", "Friend Added")

success = True

self.reload_friends()

else:

msg.showerror("Add Failed", "Friend was not found")

success = False

return success

开发者ID:PacktPublishing,项目名称:Tkinter-GUI-Programming-by-Example,代码行数:12,

示例7: say_hello

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def say_hello(self):

msgbox.showinfo("Hello", "Hello World!")

开发者ID:PacktPublishing,项目名称:Tkinter-GUI-Programming-by-Example,代码行数:4,

示例8: say_goodbye

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def say_goodbye(self):

if msgbox.askyesno("Close Window?", "Would you like to close this window?"):

self.label_text.set("Window will close in 2 seconds")

self.after(2000, self.destroy)

else:

msgbox.showinfo("Not Closing", "Great! This window will stay open.")

开发者ID:PacktPublishing,项目名称:Tkinter-GUI-Programming-by-Example,代码行数:8,

示例9: say_hello

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def say_hello(self):

message = "Hello there " + self.name_entry.get()

msgbox.showinfo("Hello", message)

开发者ID:PacktPublishing,项目名称:Tkinter-GUI-Programming-by-Example,代码行数:5,

示例10: say_goodbye

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def say_goodbye(self):

self.label_text.set("Window will close in 2 seconds")

msgbox.showinfo("Goodbye!", "Goodbye, it's been fun!")

self.after(2000, self.destroy)

开发者ID:PacktPublishing,项目名称:Tkinter-GUI-Programming-by-Example,代码行数:6,

示例11: show_about_page

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def show_about_page(self):

msg.showinfo("About", "My text editor, version 2, written in Python3.6 using tkinter!")

开发者ID:PacktPublishing,项目名称:Tkinter-GUI-Programming-by-Example,代码行数:4,

示例12: filter_help

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def filter_help(self, event=None):

msg = ("Enter a lambda function which returns True if you wish\n"

"to show nodes with ONLY a given property.\n"

"Parameters are:\n"

" - u, the node's name, and \n"

" - d, the data dictionary.\n\n"

"Example: \n"

" d.get('color',None)=='red'\n"

"would show only red nodes.\n"

"Example 2:\n"

" str(u).is_digit()\n"

"would show only nodes which have a numerical name.\n\n"

"Multiple filters are ANDed together.")

tkm.showinfo("Filter Condition", msg)

开发者ID:jsexauer,项目名称:networkx_viewer,代码行数:16,

示例13: image_pdf

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def image_pdf(file_dir):

dir_name, base_name = get_dir_name(file_dir)

doc = fitz.Document()

for img in sorted(glob.glob(file_dir + '\\*'), key=os.path.getmtime): # 排序获得对象

img_doc = fitz.Document(img) # 获得图片对象

pdf_bytes = img_doc.convertToPDF() # 获得图片流对象

img_pdf = fitz.Document("pdf", pdf_bytes) # 将图片流创建单个的PDF文件

doc.insertPDF(img_pdf) # 将单个文件插入到文档

img_doc.close()

img_pdf.close()

doc.save(dir_name + os.sep + base_name + ".pdf") # 保存文档

doc.close()

messagebox.showinfo('提示', '转换成功!')

开发者ID:jtyoui,项目名称:Jtyoui,代码行数:15,代码来源:tk.py

示例14: pdf_image

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def pdf_image(pdf_name):

dir_name, base_name = get_dir_name(pdf_name)

pdf = fitz.Document(pdf_name)

for pg in range(0, pdf.pageCount):

page = pdf[pg] # 获得每一页的对象

trans = fitz.Matrix(1.0, 1.0).preRotate(0)

pm = page.getPixmap(matrix=trans, alpha=False) # 获得每一页的流对象

pm.writePNG(FILE[:-4] + os.sep + base_name[:-4] + '_{:0>4d}.png'.format(pg + 1)) # 保存图片

pdf.close()

messagebox.showinfo('提示', '转换成功!')

开发者ID:jtyoui,项目名称:Jtyoui,代码行数:12,代码来源:tk.py

示例15: popup

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def popup(title, msg):

root = tk.Tk()

root.withdraw()

messagebox.showinfo(title, msg)

root.quit()

开发者ID:int-brain-lab,项目名称:ibllib,代码行数:7,

示例16: register_user

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def register_user(self):

# Check if passwords match

if not self.options['reg_password'].get() == self.options['reg_check_password'].get():

messagebox.showwarning('ERROR', 'Passwords do not match!')

return

else:

pass

# Check if every entry was filled

if self.options['reg_username'].get() == '' or self.options['reg_password'].get() == '' or self.options['reg_name'].get() == '' or self.options['reg_surname'].get() == '' or self.options['reg_email'].get() == '' :

messagebox.showwarning("ERROR", "Not all fields were filled!")

return

else:

pass

# check if username already exists

try:

payload = {'user': self.options['reg_username'].get(), 'pwd': hashlib.sha256(self.options['reg_password'].get().encode('utf-8')).hexdigest(), 'name' : self.options['reg_name'].get(), 'surname' : self.options['reg_surname'].get(), 'email' : self.options['reg_email'].get()}

r = requests.post('https://zeznzo.nl/reg.py', data=payload)

if r.status_code == 200:

if r.text.startswith('[ERROR]'):

messagebox.showwarning('ERROR', r.text.split('[ERROR] ')[1])

return

else:

messagebox.showinfo('INFO', 'User registered!')

else:

messagebox.showwarning('ERROR', 'Failed to register!\n%i' % r.status_code)

return

except Exception as e:

messagebox.showwarning('ERROR', '%s' % e)

return

self.reg.destroy()

开发者ID:leonv024,项目名称:RAASNet,代码行数:38,

示例17: delete_me

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def delete_me(self):

return messagebox.showinfo('Cannot do that', 'Please, visit: http://jezsjxtthkqhlqoc.onion/ with Tor browser and login.\n\nYou can delete your profile under the Profile section there.')

开发者ID:leonv024,项目名称:RAASNet,代码行数:4,

示例18: compile_decrypt

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def compile_decrypt(self):

try:

decrypt = open(self.options['decryptor_path'].get()).read()

except FileNotFoundError:

return messagebox.showerror('ERROR', 'File does not exist, check decryptor path!')

try:

if self.options['os'].get() == 'windows':

py = 'pyinstaller.exe'

else:

py = 'pyinstaller'

if not 'from tkinter.ttk import' in decrypt:

tk = ''

else:

tk = '--hidden-import tkinter --hiddenimport tkinter.ttk --hidden-import io'

if not 'from Crypto import Random' in decrypt:

crypto = ''

else:

crypto = '--hidden-import pycryptodome'

if not 'import pyaes' in decrypt:

pyaes = ''

else:

pyaes = '--hidden-import pyaes'

if not 'from pymsgbox':

pymsg = ''

else:

pymsg = '--hidden-import pymsgbox'

os.system('%s -F -w %s %s %s %s %s' % (py, tk, crypto, pyaes, pymsg, self.options['decryptor_path'].get()))

messagebox.showinfo('SUCCESS', 'Compiled successfully!\nFile located in: dist/\n\nHappy Hacking!')

self.comp.destroy()

except Exception as e:

messagebox.showwarning('ERROR', 'Failed to compile!\n\n%s' % e)

开发者ID:leonv024,项目名称:RAASNet,代码行数:41,

示例19: view_license

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def view_license(self):

messagebox.showinfo('License', 'Software: Free (Public Test)\nLicense: GNU General Public License v3.0')

开发者ID:leonv024,项目名称:RAASNet,代码行数:4,

示例20: show_dialog

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def show_dialog(self, text):

messagebox.showinfo('Info', text)

开发者ID:llSourcell,项目名称:Introduction_Move37,代码行数:4,代码来源:ui.py

示例21: help

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def help(self, event=None):

paras = [

"""{} is a basic plain text editor (using the UTF-8 encoding).""".format(

APPNAME),

"""The purpose is really to show how to create a standard

main-window-style application with menus, toolbars, etc.,

as well as showing basic use of the Text widget.""",

]

messagebox.showinfo("{} — {}".format(HELP, APPNAME),

"\n\n".join([para.replace("\n", " ") for para in paras]),

parent=self)

开发者ID:lovexiaov,项目名称:python-in-practice,代码行数:13,

示例22: _check_game_over

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def _check_game_over(self):

userWon, canMove = self._check_tiles()

title = message = None

if userWon:

title, message = self._user_won()

elif not canMove:

title = "Game Over"

message = "Game over with a score of {:,}.".format(

self.score)

if title is not None:

messagebox.showinfo("{} — {}".format(title, APPNAME), message,

parent=self)

self.new_game()

else:

self.update_score()

开发者ID:lovexiaov,项目名称:python-in-practice,代码行数:17,

示例23: help

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def help(self, event=None):

paras = [

"""Reads all the images in the source directory and produces smoothly

scaled copies in the target directory."""]

messagebox.showinfo("Help — {}".format(APPNAME),

"\n\n".join([para.replace("\n", " ") for para in paras]),

parent=self)

开发者ID:lovexiaov,项目名称:python-in-practice,代码行数:9,

示例24: help

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def help(self, event=None):

paras = [

"""{} is a basic plain text editor (using the UTF-8 encoding).""".format(

APPNAME),

"""The purpose is really to show how to create a standard

main-window-style application with menus, toolbars, dock windows, etc.,

as well as showing basic use of the Text widget.""",

]

messagebox.showinfo("{} — {}".format(HELP, APPNAME),

"\n\n".join([para.replace("\n", " ") for para in paras]),

parent=self)

开发者ID:lovexiaov,项目名称:python-in-practice,代码行数:13,

示例25: savebarcode

​点赞 5

# 需要导入模块: from tkinter import messagebox [as 别名]

# 或者: from tkinter.messagebox import showinfo [as 别名]

def savebarcode(self, bcodevalue, autoname=False):

savestate = False

fname = ""

if autoname:

fname = self.filedir + '/' + bcodevalue + '.' + self.filetype.lower()

else:

fname = fdial.asksaveasfilename(

defaultextension='png',

parent=self.master,

title='Saving barcode',

filetypes=[

('PNG',

'*.png'),

('JPEG',

'*.jpg *.jpeg'),

('GIF',

'*.gif'),

('Adobe PDF',

'*.pdf'),

('Barcha fayllar',

'*.*')])

if(fname):

tmpbarcode = self.generatebarcode(bcodevalue)

tmpbarcode.filename = fname

savestate = tmpbarcode.validate_create_barcode()

if(not savestate):

mbox.showerror("Warning", "Barcode saving error")

else:

mbox.showinfo("Info", "Barcode is saved as file successfully")

开发者ID:bzimor,项目名称:Barcode-generator,代码行数:31,

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

python messagebox弹窗退出_Python messagebox.showinfo方法代码示例相关推荐

  1. python连接redis哨兵_Python redis.sentinel方法代码示例

    本文整理汇总了Python中redis.sentinel方法的典型用法代码示例.如果您正苦于以下问题:Python redis.sentinel方法的具体用法?Python redis.sentine ...

  2. python程序异常实例_Python werkzeug.exceptions方法代码示例

    本文整理汇总了Python中werkzeug.exceptions方法的典型用法代码示例.如果您正苦于以下问题:Python werkzeug.exceptions方法的具体用法?Python wer ...

  3. python中geometry用法_Python geometry.Point方法代码示例

    本文整理汇总了Python中shapely.geometry.Point方法的典型用法代码示例.如果您正苦于以下问题:Python geometry.Point方法的具体用法?Python geome ...

  4. python re 简单实例_Python re.search方法代码示例

    本文整理汇总了Python中re.search方法的典型用法代码示例.如果您正苦于以下问题:Python re.search方法的具体用法?Python re.search怎么用?Python re. ...

  5. python中config命令_Python config.config方法代码示例

    本文整理汇总了Python中config.config方法的典型用法代码示例.如果您正苦于以下问题:Python config.config方法的具体用法?Python config.config怎么 ...

  6. python中fact用法_Python covariance.EllipticEnvelope方法代码示例

    本文整理汇总了Python中sklearn.covariance.EllipticEnvelope方法的典型用法代码示例.如果您正苦于以下问题:Python covariance.EllipticEn ...

  7. python 求 gamma 分布_Python stats.gamma方法代码示例

    本文整理汇总了Python中scipy.stats.gamma方法的典型用法代码示例.如果您正苦于以下问题:Python stats.gamma方法的具体用法?Python stats.gamma怎么 ...

  8. python安装mlab库_Python mlab.normpdf方法代码示例

    本文整理汇总了Python中matplotlib.mlab.normpdf方法的典型用法代码示例.如果您正苦于以下问题:Python mlab.normpdf方法的具体用法?Python mlab.n ...

  9. python的mag模块_Python mlab.specgram方法代码示例

    本文整理汇总了Python中matplotlib.mlab.specgram方法的典型用法代码示例.如果您正苦于以下问题:Python mlab.specgram方法的具体用法?Python mlab ...

最新文章

  1. 玩转 Python 爬虫,需要先知道这些
  2. 第二十章:异步和文件I/O.(十一)
  3. eclipse+maven+jetty环境下修改了文件需要重启才能修改成功
  4. MySQL事物系列:1:事物简介
  5. ISIS 7 Professional仿真——键控流水灯
  6. 安卓欢迎界面和activity之间的跳转问题
  7. 如何在JavaScript中克隆数组
  8. 前端学习(2686):重读vue电商网站7之登录预校验
  9. python实例之 67,68
  10. 蛋制品加工行业调研报告 - 市场现状分析与发展前景预测(2021-2027年)
  11. 29.优化 MySQL Server
  12. 使用JMeter进行压力测试
  13. 关于golang如何生成文档
  14. Axure 8 团队协作
  15. 老板让全体员工《致加西亚的信》
  16. 【商城秒杀项目】-- 项目总结
  17. Spring IOC/DI和AOP
  18. Delphi7 将Excel导入数据库
  19. WML语言基础-WML语言基础(WAP建站)
  20. 我来一下对比阿里云服务器和腾讯云服务器的优劣和区别

热门文章

  1. MySQL表名的大小写敏感设定
  2. MySQL之MHA高可用配置及故障切换(理论加实战详细部署步骤)
  3. 12.05—12.11java学习周记
  4. 计算机考试ASP题目怎么做,ASP学生考试系统
  5. 用foobar2000将高清音频(APE,FLAC等)转成m4a的方法
  6. IT互联网公司—富贵险中求的职业,千万别去
  7. 图片上传第三方(ucloud、oss)
  8. 解读炳叔在客齐集的演讲
  9. /usr/include/c++/7/bits中头文件被破坏/环境破坏
  10. 内存卡不小心格式化了?小江教你恢复!