当前位置: 首页>>代码示例>>Python>>正文


Python Application.connect_方法代码示例

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


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

示例1: do_test_2

# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import connect_ [as 别名]
def do_test_2():
    "2nd Watsup Test"
    filename = 'atestfile.txt'

    if os.path.exists(filename):
        os.remove(filename)

    app = Application()
    try:
        app.connect_(title ='Simple Form')
    except WindowNotFoundError:
        app.start_(r'examples\simple.exe')

    form = app.SimpleForm

    form.Edit.SetText(filename)
    sleep(.6)

    print 'clicking button to create file'
    form.CreateFile.Click()

    # now check that the file is there
    if os.path.exists(filename):
        print 'file %s is present' % filename
    else:
        print "file %s isn't there" % filename

    form.MenuSelect("File->Exit")
开发者ID:Aarav,项目名称:Projects,代码行数:30,代码来源:watsup_ex1.py

示例2: do_test_3

# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import connect_ [as 别名]
def do_test_3():
    "3rd Watsup Test"
    app = Application()
    try:
        app.connect_(title ='Performance Form 2')
    except WindowNotFoundError:
        app.start_(r'examples\perform2.exe')

    app.PerformanceForm1.Clickme.Click()
    waited = 0
    while not app.PerformacneForm1.Edit1._.Texts and not waited >= 1:
        print 'waiting'
        sleep(.1)
        waited += .1

    print `app.PerformacneForm1.Edit1._.Texts`
开发者ID:Aarav,项目名称:Projects,代码行数:18,代码来源:watsup_ex1.py


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