本文整理汇总了Python中tkMessageBox.showwarning函数的典型用法代码示例。如果您正苦于以下问题:Python showwarning函数的具体用法?Python showwarning怎么用?Python showwarning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showwarning函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: checksheet_name
def checksheet_name(name):
if name == '':
tkMessageBox.showwarning("Whoops", "Name should not be blank.")
return 0
if self.sheets.has_key(name):
tkMessageBox.showwarning("Name exists", "Sheet name already exists!")
return 0
开发者ID:ShaBren,项目名称:tkintertable,代码行数:7,代码来源:TablesApp.py
示例2: __init__
def __init__(self, host = HOST, port = PORT, start_server = True):
self.addr = (host, port)
self.connected = False
self.failed = False
self.server_process = None
if start_server:
missing = set([])
try:
import wx
except ImportError:
missing.add('wx')
try:
import matplotlib
except ImportError:
missing.add('matplotlib')
try:
import numpy
except ImportError:
missing.add('numpy')
if not len(missing):
try:
self.server_process = Popen(['python','plot_server.py'])
print 'plot server started!'
except:
print 'Could not start plot server!'
else:
import tkMessageBox
tkMessageBox.showwarning('Warning!', 'Could not start plot window because the following module(s) are missing: ' + ', '.join(missing))
开发者ID:DavidDeAngelo,项目名称:opennero,代码行数:28,代码来源:plot_client.py
示例3: start
def start(self):
if self.state == self.gs_running:
self.start_button["text"] = "Run"
self.run_tracking_semaphore.clear();
self.state = self.gs_paused
elif self.state == self.gs_paused:
self.start_button["text"] = "Pause"
self.run_tracking_semaphore.set();
self.next_frame_semaphore.set();
self.state = self.gs_running
self.root.after(1, self.poll_tracking_flow)
else:
bg = cv2.imread(self.get_bg_file_name())
if bg is None:
tkMessageBox.showwarning('Start tracking', 'Can''t find the backgound image file')
return;
self.start_button["text"] = "Pause"
self.run_tracking_semaphore.set();
self.tracking_thread = threading.Thread(target = self.tracking.do_tracking, args =
(bg, self.current_frame_number, self.tracking_flow, self.time_to_stop, self.next_frame_semaphore, self.run_tracking_semaphore))
# self.tracking.do_tracking(self.video_file_name, self.current_frame_number, self.tracking_flow, self.time_to_stop);
analyzer_state = self.analyzer_states[self.analyzer_index.get()]
if not (analyzer_state is None):
self.analyzer = analyzer_state.factory.create_analyzer(analyzer_state.configuration, TextBoxLogger(self.analyzer_messages))
else:
self.analyzer = None
self.tracking_thread.start()
self.poll_tracking_flow()
self.state = self.gs_running
开发者ID:der-tim,项目名称:ratrack,代码行数:35,代码来源:main.py
示例4: _CreateWidgetsAgentsNeutral
def _CreateWidgetsAgentsNeutral(self):
"""
This intialises and displays the neutral agent's widgets
Arguments:
Specifics:
"""
try:
self.NeutralOptimism = StringVar()
self.NeutralOptimism.set("10")
self.txtNeutralOptimism = Entry(self, textvariable=self.NeutralOptimism)
self.txtNeutralOptimism.grid(row=8, column=1)
self.NeutralPessimism = StringVar()
self.NeutralPessimism.set("10")
self.txtNeutralPessimism = Entry(self, textvariable=self.NeutralPessimism)
self.txtNeutralPessimism.grid(row=8, column=2)
self.NumberOfNeutral = StringVar()
self.NumberOfNeutral.set("0")
self.txtNumberOfNeutral = Entry(self, textvariable=self.NumberOfNeutral)
self.txtNumberOfNeutral.grid(row=8, column=3)
#// Custom Class Error's first
except:
raise ReynoldsWindowCreateWidgetsError("_CreateWidgetsAgentsNeutral Failed")
messagebox.showwarning("Internal Method Error", "_CreateWidgetsAgentsNeutral Failed")
开发者ID:ssnowden,项目名称:Reynolds-Spade,代码行数:25,代码来源:ReynoldsWindow.py
示例5: 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
示例6: new_plink
def new_plink(self):
'''Draw new link in PLink'''
print '\nNew PLink'
try:
data = load_plink(gui=True)
except Exception as error:
tkMessageBox.showwarning('PLink error', \
'Perhaps PLink is not installed properly?')
print traceback.print_exc()
return
object_data = make_objects(data[0],data[1],data[2],data[3],data[4],
data[5])
regions = object_data[3]
if data[6] == '':
path = 'PLink data not saved'
print path
else:
path = data[6]
print 'Saved to %s' %path
if self.show_shaded.get():
vie = (object_data[0], object_data[1], object_data[2])
# Vertices, Intersections, Edges
else:
vie = None
self.p_output(regions, vie, path)
开发者ID:panaviatornado,项目名称:hfhom,代码行数:26,代码来源:gui.py
示例7: _CreateWidgetsAgentsPessimistic
def _CreateWidgetsAgentsPessimistic(self):
"""
This intialises and displays the pessimistic agent's widgets
Arguments:
Specifics:
"""
try:
self.PessimisticOptimism = StringVar()
self.PessimisticOptimism.set("20")
self.txtPessimisticOptimism = Entry(self, textvariable=self.PessimisticOptimism)
self.txtPessimisticOptimism.grid(row=5, column=1)
self.PessimisticPessimism = StringVar()
self.PessimisticPessimism.set("50")
self.txtPessimisticPessimism = Entry(self, textvariable=self.PessimisticPessimism)
self.txtPessimisticPessimism.grid(row=5, column=2)
self.NumberOfPessimists = StringVar()
self.NumberOfPessimists.set("0")
self.txtNumberOfPessimists = Entry(self, textvariable=self.NumberOfPessimists)
self.txtNumberOfPessimists.grid(row=5, column=3)
#// Custom Class Error's first
except:
raise ReynoldsWindowCreateWidgetsError("_CreateWidgetsAgentsPessimistic Failed")
messagebox.showwarning("Internal Method Error", "_CreateWidgetsAgentsPessimistic Failed")
开发者ID:ssnowden,项目名称:Reynolds-Spade,代码行数:25,代码来源:ReynoldsWindow.py
示例8: loadDG7
def loadDG7(self, fields, data):
if data.has_key('5F43'):
try:
stream = convertImage(data['5F43'][0])
self.updatePicture(stream, self.SIGN)
except Exception, msg:
tkMessageBox.showwarning("Image Error", str(msg))
开发者ID:akpotter,项目名称:epassportviewer,代码行数:7,代码来源:overview.py
示例9: apply
def apply(self):
self.result.append( self.e1.get(tk.ACTIVE) )
self.result.append( self.e2.get(tk.ACTIVE) )
if not self.e1.curselection():
self.result[0] = None
print "e1 active is ", self.result[0]
if not self.e2.curselection():
self.result[1] = None
print "e2 active is ", self.result[1]
length = 0
for i in range(len(self.result)):
if self.result[i] != None:
length+=1
if(length == 2):
return self.result
else:
tkMessageBox.showwarning("Instructions", "You must select an independent and a dependent variable")
return None
开发者ID:acarlson101,项目名称:Data-Visualization,代码行数:25,代码来源:display.py
示例10: add_show
def add_show(self,default):
# append it to the showlist and then add the medialist
if self.current_showlist<>None:
d = Edit1Dialog(self.root,"AddShow",
"Show Reference", "")
if d.result == None:
return
name=str(d.result)
if name=="":
tkMessageBox.showwarning(
"Add Show",
"Name is blank"
)
return
if self.current_showlist.index_of_show(name)<>-1:
tkMessageBox.showwarning(
"Add Show",
"A Show with this name already exists"
)
return
copied_show=self.current_showlist.copy(default,name)
mediafile=self.add_medialist(name)
if mediafile<>'':
copied_show['medialist']=mediafile
self.current_showlist.append(copied_show)
self.save_showlist(self.pp_profile_dir)
self.refresh_shows_display()
开发者ID:KenT2,项目名称:pipresents-next,代码行数:27,代码来源:pp_editor.py
示例11: add_medialist
def add_medialist(self,name=None):
if name==None:
d = Edit1Dialog(self.root,"Add Medialist",
"File", "")
if d.result == None:
return ''
name=str(d.result)
if name=="":
tkMessageBox.showwarning(
"Add medialist",
"Name is blank"
)
return ''
if not name.endswith(".json"):
name=name+(".json")
path = self.pp_profile_dir + os.sep + name
if os.path.exists(path)== True:
tkMessageBox.showwarning("Add medialist","Medialist file exists\n(%s)" % path)
return ''
nfile = open(path,'wb')
nfile.write("{")
nfile.write("\"issue\": \""+self.editor_issue+"\",\n")
nfile.write("\"tracks\": [")
nfile.write("]")
nfile.write("}")
nfile.close()
# append it to the list
self.medialists.append(copy.deepcopy(name))
# add title to medialists display
self.medialists_display.insert(END, name)
# and set it as the selected medialist
self.refresh_medialists_display()
return name
开发者ID:KenT2,项目名称:pipresents-next,代码行数:35,代码来源:pp_editor.py
示例12: validate
def validate(self):
try:
self.result = (int(self.s_sx.get()), int(self.s_sy.get()), int(self.s_ox.get()), int(self.s_oy.get()))
return 1
except ValueError:
tkMessageBox.showwarning("Bad Input", "Only Integers allowed")
return 0
开发者ID:antonxy,项目名称:imagepresenter,代码行数:7,代码来源:main_frame.py
示例13: search
def search(cls, event=None):
"Search the text in the search_entry widget by creating a new instance "
"of the ConcurrentSearch class (after validating it by means of the "
"validate_question function in the question module), and depict the "
"results obtained in the results_listbox widget "
"The contents of the sv variable will be displayed on the "
"message_index widget, and updated by the thread responsible for "
"carrying out the index operation"
input = cls.search_entry.get()
cls.results_listbox.delete(0, END)
if question.validate_question_string(input):
cls.similar_button.pack(side=RIGHT, pady=10)
window_index = Toplevel(cls.top, width=200)
window_index.title("Buscando...")
window_index.wm_iconbitmap(bitmap="@python.xbm")
sv = StringVar()
message_index = Message(window_index, textvariable=sv, aspect=800)
message_index.pack(side=LEFT, fill=BOTH, expand=1)
t_search = cls.ConcurrentSearch(
output_stream=sv, results_output=cls.results_listbox, algorithm=cls.algorithm.get(), question=input
)
t_search.start()
else:
tkMessageBox.showwarning(
"Entrada no valida", "La pregunta realizada debe cumplir con el formato: (termino peso?)+\n"
)
开发者ID:systematic-chaos,项目名称:sari,代码行数:30,代码来源:ari.py
示例14: _mouseWheel
def _mouseWheel(self, event):
"""
Mouse wheel moved
"""
# event.num == 4 -> up
# event.num == 5 -> down
#print "mouse wheel ",event
val = self.odf[self.selectedPar.get()]
pname = self.selectedPar.get()
try:
if self.modModus.get() == "add":
mf = float(self.modEntryTextAdd.get())
elif self.modModus.get() == "mul":
mf = float(self.modEntryTextMul.get())
except ValueError:
tkMessageBox.showwarning("Invalid float", "Cannot convert " + self.modEntry.get() + " to float." + \
" Make it a valid value to proceed.")
return
if event.num == 4:
if self.modModus.get() == "mul":
self.odf[pname] = val * mf
else:
self.odf[pname] = val + mf
elif event.num == 5:
if self.modModus.get() == "mul":
self.odf[pname] = val / mf
else:
self.odf[pname] = val - mf
self._parameterValueChanged()
开发者ID:dhomeier,项目名称:PyAstronomy,代码行数:29,代码来源:ffmodelExplorer.py
示例15: paste_DNA
def paste_DNA(self,event=None):
"""Paste stuff"""
text=self.master.selection_get(selection = "CLIPBOARD")
# Check that we have DNA
import string
text=string.replace(text,'\n','')
text=string.replace(text,'\r','')
text=string.replace(text,' ','')
DNA=['A','C','G','T','a','c','g','t']
for letter in text:
if not letter in DNA:
tkMessageBox.showwarning('Invalid DNA sequence',
'"%s" is not a valid DNA sequence. \n"%s" is first illegal base.' %(text,letter),
parent=self.master)
return
# Make upper case
text=string.upper(text)
# ok
start=self.data['DNA_selection']['start']
stop=self.data['DNA_selection']['stop']
p_start=min(start,stop)
p_end=max(start,stop)
self.data['DNAseq']=self.data['DNAseq'][:p_start]+text+self.data['DNAseq'][p_end:]
self.clear_selection()
self.update_sequence_window()
return
开发者ID:shambo001,项目名称:peat,代码行数:33,代码来源:DNA_Edit.py
示例16: handleChooseAxes
def handleChooseAxes(self, headers = '', cluster=False):
if headers == '':
self.createDialog(self.data.get_headers())
else:
self.createDialog(headers, cluster=True)
print "okField ", self.ok
ret = []
if self.ok == False:
self.label['text'] = "Data selection cancelled"
return None
if self.xData == None or self.yData == None:
print "in here again"
tkMessageBox.showwarning("Instructions", "You must input data for the x and y coordinates")
return None
ret.append(self.xData)
ret.append(self.yData)
if self.zData != None:
ret.append(self.zData)
if self.colorData != None:
ret.append(self.colorData)
if self.sizeData != None:
ret.append(self.sizeData)
return [self.xData,self.yData, self.zData, self.colorData, self.sizeData]
开发者ID:acarlson101,项目名称:Data-Visualization,代码行数:25,代码来源:display.py
示例17: k_load_file
def k_load_file(self):
'''select file to load'''
# open file options
options = {}
options['defaultextension'] = '.txt'
options['filetypes'] = [('all files', '.*'), ('text files', '.txt')]
self.filename = tkFileDialog.askopenfilename(**options)
if self.filename == '': # canceled
return
try:
print '\n%s' %self.filename
data = load(self.filename, filename=True)
regions = data[3]
except Exception as error:
tkMessageBox.showwarning('Loading', \
'Loading failed (%s)\n%s'
%(self.filename, \
traceback.format_exc().splitlines()[-1]))
print traceback.print_exc()
return
if self.show_shaded.get():
vie = (data[0], data[1], data[2]) # Vertices, Intersections, Edges
else:
vie = None
self.k_output(regions, vie, self.filename)
开发者ID:panaviatornado,项目名称:hfhom,代码行数:28,代码来源:gui.py
示例18: deleteAnalysis
def deleteAnalysis(self,event=None):
if len(self.box.curselection()) > 0:
self.results.pop(self.box.get(self.box.curselection()[0]), None)
self.box.delete(self.box.curselection()[0])
else:
tkMessageBox.showwarning("Instructions", "Please select an analysis")
开发者ID:acarlson101,项目名称:Data-Visualization,代码行数:7,代码来源:display.py
示例19: p_load_file
def p_load_file(self):
'''Select PLink file to load'''
# open file options
options = {}
options['defaultextension'] = '.txt'
options['filetypes'] = [('link files', '.lnk'), ('all files', '.*'),\
('text files', '.txt')]
filename = tkFileDialog.askopenfilename(**options)
if filename == '': # no file selected (canceled)
return
try:
print '\n%s' %filename
data = load_plink(filename, gui=True)
object_data = make_objects(data[0],data[1],data[2],data[3],data[4],
data[5])
regions = object_data[3]
except Exception as error:
tkMessageBox.showwarning('Loading', \
'Loading failed (%s)\n%s' \
%(filename,
traceback.format_exc().splitlines()[-1]))
print traceback.print_exc()
return
if self.show_shaded.get():
vie = (object_data[0], object_data[1], object_data[2])
# Vertices, Intersections, Edges
else:
vie = None
self.p_output(regions, vie, filename)
开发者ID:panaviatornado,项目名称:hfhom,代码行数:30,代码来源:gui.py
示例20: handlePCA
def handlePCA(self, event=None):
if self.data == None:
tkMessageBox.showwarning("Instructions", "You must read in a file first")
return
headers = self.data.get_headers()
p = PCASelect(self.root,headers)
print p.result
if not p.result:
return
else:
if p.result[2] in self.results.keys():
tkMessageBox.showwarning("Instructions", "You have already used that filename. Either delete it (Select then Cmd-d) or choose a new name")
return
self.label['text'] = "PCA Read Successful"
self.results[p.result[2]] = [self.data, p.result[1], p.result[0] ]
if not self.made_analysis:
self.made_analysis = True
label = tk.Label( self.position, text="PCA Data Sets", width=20, fg='Black' )
label.pack( side=tk.TOP, pady=2 )
self.box = tk.Listbox(self.position, selectmode=tk.SINGLE, exportselection=0)
self.box.pack( side=tk.TOP, pady=2 )
button = tk.Button( self.position, text="Plot PCA",
command=self.plotPCA )
button.pack(side=tk.TOP) # default side is top
self.box.insert(tk.END, p.result[2])
开发者ID:acarlson101,项目名称:Data-Visualization,代码行数:25,代码来源:display.py
注:本文中的tkMessageBox.showwarning函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论