本文整理汇总了Python中testing.say函数的典型用法代码示例。如果您正苦于以下问题:Python say函数的具体用法?Python say怎么用?Python say使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了say函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_mixed
def make_mixed():
try:
box.on = 'mixed'
except ValueError:
e = sys.exc_info()[1]
say(e)
report()
示例2: select
def select():
i = group.value
name = cursor_names[i]
say("Selecting cursor no. %d (%s)" % (i, name))
cursor = getattr(StdCursors, name)
say("...", cursor)
view.cursor = cursor
示例3: do_old_files
def do_old_files(self):
say("Doing request_old_files")
if self.filt.on:
file_types = [self.file_type]
else:
file_types = None
result = FileDialogs.request_old_files("Open Dusty Old Files:",
default_dir = last_dir, file_types = file_types)
self.save_result(result)
示例4: do_new_file
def do_new_file(self):
say("Doing request_new_file with default_dir = %s, default_name = %r"
% (last_dir, last_name))
if self.filt.on:
file_type = self.file_type
else:
file_type = None
result = FileDialogs.request_new_file("Save Shiny New File:",
default_dir = last_dir, default_name = last_name, file_type = file_type)
self.save_result(result)
示例5: main
def main():
get_test_names()
while 1:
list_tests()
name = get_test()
print
# cmd = r"c:\python25\python %s" % name
cmd = "%s %s" % (sys.executable, name)
say("Executing:", repr(cmd))
os.system(cmd)
示例6: get_test
def get_test():
while 1:
prefix = ask("Test? ")
if not prefix:
sys.exit(0)
matches = glob("%s-*.py" % prefix)
if not matches:
say("Unknown test")
continue
if len(matches) > 1:
say("Ambiguous")
continue
return matches[0]
示例7: modal_dialog
def modal_dialog():
#global dlog ###
dlog = ModalDialog(title = "Spanish Inquisition", size = (200, 140))
dlog.place(Label(text = "Surprise!!!"), left = 20, top = 20)
field = TextField()
dlog.place(field, left = 20, top = 60, right = -20)
field.become_target()
dlog.default_button = DefaultButton()
dlog.cancel_button = CancelButton()
dlog.place(dlog.default_button, right = -20, bottom = -20)
dlog.place(dlog.cancel_button, left = 20, bottom = -20)
dlog.center()
result = dlog.present()
say("Result =", result)
dlog.destroy()
示例8: mouse_down
def mouse_down(self, event):
say("Mouse down:", event.position)
for event in self.track_mouse():
if event.kind == 'mouse_drag':
say("Mouse drag:", event.position)
elif event.kind == 'mouse_up':
say("Mouse up:", event.position)
else:
say("Other event:", event.kind)
示例9: draw
def draw(self, c, r):
if self.report_update_rect:
say("Update rect =", r)
viewed_rect = self.viewed_rect()
c.fillcolor = white
c.fill_rect(viewed_rect)
c.pensize = 6
c.fillcolor = red
x = 20
y = 10
for i in range(0, 20):
c.newpath()
c.moveto(x - 20, y + 20)
c.rlineto(80, -20)
c.rlineto(-40, 60)
c.closepath()
c.fill()
c.stroke()
x += 80
y += 80
ew, eh = self.extent
c.frame_rect((0, 0, ew, eh))
示例10: save_result
def save_result(self, result):
if isinstance(result, list):
say("Result:")
for item in result:
say(" ", item)
else:
say("Result =", result)
print
global last_dir, last_name
if result:
if isinstance(result, FileRef):
last_dir = result.dir
last_name = result.name
elif isinstance(result, DirRef):
say("Setting last_dir to", result) ###
last_dir = result
示例11: show_text
def show_text(win):
fields = [win.tf1, win.tf2, win.tf3]
n = None
t = application().target
for i, f in enumerate(fields):
say("Field %d:" % (i + 1), repr(f.text))
if f is t:
n = i + 1
if n:
say("Focus: Field %d: Selection = %r" % (n, t.selection))
else:
say("No focus")
示例12: key_down
def key_down(self, event):
say("char = %r key = %r unichars = %r _keycode = 0x%04x" % (
event.char, event.key, event.unichars, event._keycode))
示例13: bing
def bing():
say("Bing!")
示例14: key_up
def key_up(self, event):
say("Key up: %s\n" % event)
示例15: auto_key
def auto_key(self, event):
say("Auto key: %s\n" % event)