Pywinauto-0.6.8 findbestmatch用户模块类 电脑端软件GUI鼠标键盘Python自动化办公、测试、重复性工作制定库

用于查找列表中字符串最接近匹配项的模块

exception pywinauto.findbestmatch.MatchError(items=None, tofind='')

找不到合适的匹配项

findbestmatch.UniqueDict

class pywinauto.findbestmatch.UniqueDict

一个字典子类,用于处理使其键唯一

findbestmatch.UniqueDict.find_best_matches

pywinauto.findbestmatch.UniqueDict.find_best_matches(search_text, clean=False, ignore_case=False)

返回项目中search_text的最佳匹配项

参数:

参数说明
search_text要查找的文本
clean是否清除字符串中的非文本字符
ignore_case不敏感地比较字符串大小写

findbestmatch.build_unique_dict

pywinauto.findbestmatch.build_unique_dict(controls)

生成消除歧义的控件列表

分离出不同的函数,以便我们可以获取用于打印的控制标识符。

findbestmatch.find_best_control_matches

pywinauto.findbestmatch.find_best_control_matches(search_text, controls)

返回与 search_text 匹配的最佳控件

这与 find_best_match 略有不同,因为它使用来自每个控件的信息构建要搜索的文本项列表。因此,例如,对于有一个 OK、Button,则以下内容都添加到搜索列表中:“OK”、“Button”、“OKButton”
但是,如果有一个 ListView(没有可见的“文本”),那么它只会添加“ListView”。

findbestmatch.find_best_match

pywinauto.findbestmatch.find_best_match(search_text, item_texts, items, limit_ratio=0.5)

返回回与 search_text 最匹配的物品

参数说明
search_text要搜索的文本
item_texts要搜索的文本列表
items与要搜索的文本列表对应的项目列表(1 到 1)
limit_ratio文本与最佳匹配的匹配程度。如果最佳匹配项匹配值低于此匹配项,则不将其视为匹配项,并引发 MatchError(默认值 = 0.5)

findbestmatch.get_control_names

pywinauto.findbestmatch.get_control_names(control, allcontrols, textcontrols)

返回此控件的名称列表

findbestmatch.get_non_text_control_name

pywinauto.findbestmatch.get_non_text_control_name(ctrl, controls, text_ctrls)

通过查找其上方和左侧最接近的文本控件来返回此控件的名称

findbestmatch.is_above_or_to_left

pywinauto.findbestmatch.is_above_or_to_left(ref_control, other_ctrl)

如果other_ctrl位于ref_control的上方或左侧,则返回 true

  • 8
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ょ镜花う水月

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值