动作链的type()可接收list和tuple

This commit is contained in:
g1879 2023-04-20 11:40:50 +08:00
parent 10b3b392cf
commit e241649a1d
2 changed files with 6 additions and 5 deletions

View File

@ -252,13 +252,14 @@ class ActionChains:
def type(self, text): def type(self, text):
"""输入文本 """输入文本
:param text: 要输入的文本 :param text: 要输入的文本特殊字符和多个文本可用list或tuple传入
:return: self :return: self
""" """
for i in text: for i in text:
self.key_down(i) for character in i:
sleep(.05) self.key_down(character)
self.key_up(i) sleep(.05)
self.key_up(character)
return self return self
def wait(self, second): def wait(self, second):

View File

@ -65,7 +65,7 @@ class ActionChains:
def key_up(self, key: str) -> ActionChains: ... def key_up(self, key: str) -> ActionChains: ...
def type(self, text: str) -> ActionChains: ... def type(self, text: Union[str, list, tuple]) -> ActionChains: ...
def wait(self, second: float) -> ActionChains: ... def wait(self, second: float) -> ActionChains: ...