【pywinauto】Spinner 无法输入

【时间】2024/7/15

【问题】想给控件属于内容

【解决】

1)使用 texts()  输入,报错

2)使用 type_keys(),键盘输入,解决

edit_box = main_window.child_window(class_name='Edit').wrapper_object()  # 替换为实际的类名或定位方式  
  
# 使用type_keys()方法模拟键盘输入  
edit_box.type_keys('Hello Spinner!', with_spaces=True)  # 输入文本,with_spaces=True表示保留空格  

 

posted on 2024-07-15 12:00  张凌赫_帅  阅读(85)  评论(0)    收藏  举报

导航