当尝试输入字符串时'customer asked for 30% discount'
通过使用到一个表单type_keys()
在 Pywinauto 0.6.5 中,它发送的输出是'customer asked for 30 discount"
省略'%'
.
尝试转义字符:
control.type_keys('customer asked for 30%% discount',with_spaces=True)
control.type_keys('customer asked for 30\% discount',with_spaces=True)
但它仍然省略了'%'
当在控制台字符串输出中正确打印数据时。所以这不是Python 3.7 的问题。
正如 Redem 已经发现的,一些特殊符号必须通过这种方式转义:
control.type_keys('customer asked for 30{%} discount', with_spaces=True)
或方法.set_edit_text()
可用于编辑框控件:
control.set_edit_text(r'customer asked for 30% discount')
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)