本文整理汇总了Python中tkMessageBox.showinfo方法的典型用法代码示例。如果您正苦于以下问题:Python tkMessageBox.showinfo方法的具体用法?Python tkMessageBox.showinfo怎么用?Python tkMessageBox.showinfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkMessageBox
的用法示例。
在下文中一共展示了tkMessageBox.showinfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: clickStartPreview
# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import showinfo [as 别名]
def clickStartPreview(self):
"""Handle 'Start Preview' button click events. """
if self.__is_verbose: print "ACTION: 'Start Preview' clicked! "
# turn on the camera preview
if self.__camera and not self.__preview_is_active:
tkMessageBox.showinfo(
title = "Show Camera Feed",
message = "Press the ESCAPE key to exit preview mode"
)
#self.__camera.brightness = 70;
#self.__camera.awb_mode = 'auto';
self.__camera.start_preview()
self.__preview_is_active = True
if self.__is_verbose: print "INFO: Camera preview started. "
# reset focus to the application frame
self.focus_set()
示例2: output_coords
# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import showinfo [as 别名]
def output_coords():
# Open the file to output the co-ordinates to
f1 = open('./setup_data.py', 'w+')
# Print the dictionary data to the file
print >>f1, 'boxes = ['
for i in range(Boxes.length()):
c = Boxes.get(i).get_output(SelWindow.bgcoords)
if c != None:
o = (i)
print >>f1, c, ','
print >>f1, ']'
print 'INFO: Box data saved in file boxdata.py.'
tkMessageBox.showinfo("Pi Setup", "Box data saved in file.")
# -----------------------------------------------------------------------------
# Main Program
# -----------------------------------------------------------------------------
示例3: print_info
# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import showinfo [as 别名]
def print_info(self, object_name, object_type):
if object_type == "AP":
tkMessageBox.showinfo(Global_Access_Points[object_name].mssid,
( "Mac address: " + Global_Access_Points[object_name].mmac +
"\nEncryption: " + Global_Access_Points[object_name].menc +
"\nChannel: " + Global_Access_Points[object_name].mch +
"\nVendor: " + Global_Access_Points[object_name].mven +
"\nSignal strength: " + str(Global_Access_Points[object_name].msig) +
"\nBeacons: " + str(Global_Access_Points[object_name].mbeacons))
)
else:
tkMessageBox.showinfo("Client Info",
("Mac address: "+Global_Clients[object_name].mmac+
"\nAccess Point Mac: "+Global_Access_Points[Global_Clients[object_name].mbssid].mmac+
"\nNoise: "+str(Global_Clients[object_name].mnoise)+
"\nSignal Strength: "+str(Global_Clients[object_name].msig)+
"\nAccess Point Name: "+Global_Access_Points[Global_Clients[object_name].mbssid].mssid)
)
print(object_name)
示例4: sdk_compile
# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import showinfo [as 别名]
def sdk_compile(plugin_dir):
makefile_dir = plugin_dir + "/Debug/"
print(makefile_dir)
make_clean_process = subprocess.Popen(["make", "clean"], cwd=makefile_dir, stdout=subprocess.PIPE)
while True:
line = make_clean_process.stdout.readline().decode()
if line != "":
print (line)
else:
break
make_all_process = subprocess.Popen(["make", "all"], cwd=makefile_dir, stdout=subprocess.PIPE)
while True:
line = make_all_process.stdout.readline().decode()
if line != "":
print (line)
else:
break
plugin_built = check_if_sdk_file_built(plugin_dir)
if not plugin_built:
tkMessageBox.showinfo("Build result", "Build Failed")
else:
tkMessageBox.showinfo("Build result", "Build Successful")
示例5: browse_file
# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import showinfo [as 别名]
def browse_file(self):
self.fname = tkFileDialog.askopenfilename(filetypes = (("Template files", "*.type"), ("All files", "*")))
# def submit(self):
# print('Name: {}'.format(self.entry_name.get()))
# print('Email: {}'.format(self.entry_email.get()))
# print('Comments: {}'.format(self.text_comments.get(1.0, 'end')))
# self.clear()
# tkMessageBox.showinfo(title = 'Explore California Feedback', message = 'Comments Submitted!')
#
# def clear(self):
# self.entry_name.delete(0, 'end')
# self.entry_email.delete(0, 'end')
# self.text_comments.delete(1.0, 'end')
#
示例6: main
# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import showinfo [as 别名]
def main():
comment = os.environ.get('CLEARCASE_COMMENT','')
version = os.environ['CLEARCASE_XPN']
error = 0
caseIds = checkComment(comment)
if not caseIds:
error = 1
tkMessageBox.showerror("Missing Case ID in check-in-comment",
"Version:\n%s\n\nKommentar:\n%s" %
(version, comment))
sys.exit(error)
# Remove # below to see what environment variables ClearCase sets.
#
#text = "\n".join( [" = ".join(x) for x in os.environ.items()
# if x[0].startswith('CLEARCASE')])
#tkMessageBox.showinfo("Environment variable", text)
示例7: send_request
# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import showinfo [as 别名]
def send_request(self, ink_stroke_list):
self._root = None
try:
root = self._client.recognize_ink(
ink_stroke_list, # Arguments for this request only.
language=LANGUAGE_RECOGNITION_LOCALE,
logging_enable=True
)
result_text = []
for word in root.ink_words:
result_text.append(word.recognized_text)
for shape in root.ink_drawings:
result_text.append(shape.recognized_shape.value)
result_text = "\n".join(result_text)
return result_text
self._root = root
except Exception as e:
messagebox.showinfo("Error", e)
# </inkClient>
# <recognitionManager>
示例8: menu_saveas
# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import showinfo [as 别名]
def menu_saveas(self):
if self.root_element is None:
tkMessageBox.showwarning(None, "Cannot save empty configuration.")
else:
fname = tkFileDialog.asksaveasfilename()
if len(fname) > 0: # file was selected
try:
with open(fname, "w") as handle:
write_json(self.root_element.serialize(), handle)
except IOError:
tkMessageBox.showerror(None, "Failed to save config file.")
else:
self.cfg_file_name.set(fname)
tkMessageBox.showinfo(
None, "Save successful:\n{}".format(self.cfg_file_name.get())
)
示例9: Change_video
# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import showinfo [as 别名]
def Change_video():
global target_video
global video_entry
global video_entrywindow
global old_frame
old_frame = -30
if video_entry.get() == "":
tkMessageBox.showinfo("Warning", "The input is invalid!")
video_entrywindow.destroy()
return
file = video_entry.get() + "/Data/" + video_entry.get() + "_" + str(index).zfill(12) + "_keypoints.json"
try:
fh = open(file)
except IOError:
print "No such file!"
tkMessageBox.showinfo("Warning", "\nDirectory not found!")
return
target_video = video_entry.get()
print target_video
video_entrywindow.destroy()
# IP Camera Set
示例10: Real_Time
# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import showinfo [as 别名]
def Real_Time():
global data_path
global ip_camera
global enable
if ip_camera == "":
tkMessageBox.showinfo("Warning", "\nPlease Set WebCam Address!")
return
data_path = "real_time"
s = "rm -rf real_time"
os.system(s)
s = "./build/examples/openpose/openpose.bin --no_display --write_images real_time/Image/ --write_keypoint_json real_time/Data --net_resolution 640x480--ip_camera " + ip_camera
os.system(s)
# time.pause(10)
enable = 1
do_analysis()
# UI TOP
示例11: showHelp
# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import showinfo [as 别名]
def showHelp(self):
helpstr='''
%s\n\n
- Export PDFs: Bulk export PDFs.\n
- Extract highlights: Extract highlighted texts and output to txt files.\n
- Extract notes: Extract notes and output to txt files.\n
- Export .bib: Export meta-data and annotations to .bib files.\n
- Export .ris: Export meta-data and annotations to .ris files.\n
- For import to Zotero: Exported .bib and/or .ris files have suitable format to import to Zotero.\n
- Save separately: If on, save each PDF's annotations to a separate txt.\n
- Use custom annotation template: Use a custom template to format the exported annotations.
See annotation_template.py for details.
- See README.md for more info.\n
''' %self.title
tkMessageBox.showinfo(title='Help', message=helpstr)
#print(self.menfolder.get())
示例12: turnOnCamera
# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import showinfo [as 别名]
def turnOnCamera(self):
"""
Instruct the user how to take a new setup image, then activate
the PiCam. If the camera fails to load, catch the exception and present
error message.
"""
# show quick dialogue box with basic instruction
tkMessageBox.showinfo(title = "",
message = "Press the ENTER key to take a new setup image "
+ "or the ESCAPE key to cancel.")
try:
# initialise the camera using the settings in the imageread module
self.__camera = imageread.setup_camera(is_fullscreen = True)
self.__camera.awb_mode = 'auto';
self.__camera.exposure_mode = 'auto';
self.__camera.start_preview()
self.__camera_is_active = True
if self.__is_verbose: print "INFO: PiCam activated."
except:
# camera failed to load, display error message
tkMessageBox.showerror(title = "Error!",
message = "Error: Failed to setup and start PiCam.")
# --------------------------------------------------------------------------
# Save Data
# --------------------------------------------------------------------------
示例13: saveData
# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import showinfo [as 别名]
def saveData(self):
"""Save the CP and parking space reference data to ./setup_data.py. """
# Open the file to output the co-ordinates to
f1 = open('./setup_data.py', 'w+')
# Print the dictionary data to the file
print >> f1, 'boxes = ['
# for every parking space, save the data to ./setup_data.py
for i in range(self.__parking_spaces.length()):
space = self.__parking_spaces.get(i).getOutput()
# ignore the space if no data present
if space != None:
o = (i)
print >> f1, space, ','
# for every control point, save the data to ./setup_data.py
for j in range(self.__control_points.length()):
cp = self.__control_points.get(j).getOutput()
# ignore the CP if no data present
if cp != None:
o = (i)
print >> f1, cp, ','
# save to ./setup_data.py
print >> f1, ']'
self.__is_saved = True
if self.__is_verbose: print 'INFO: Data saved in file setup_data.py.'
tkMessageBox.showinfo(title = "PiPark Setup",
message = "Data saved successfully.")
# --------------------------------------------------------------------------
# Load Data
# --------------------------------------------------------------------------
示例14: filter_help
# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox 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)
示例15: about
# 需要导入模块: import tkMessageBox [as 别名]
# 或者: from tkMessageBox import showinfo [as 别名]
def about(self, *e):
ABOUT = ("NLTK Chart Parser Demo\n"+
"Written by Edward Loper")
tkMessageBox.showinfo('About: Chart Parser Demo', ABOUT)
#////////////////////////////////////////////////////////////
# File Menu
#////////////////////////////////////////////////////////////