在Typing Club練習打字
結合前面的上傳檔案及pyperclip外加whereisthemouse,pyautogui來做出自動開啟檔案及查詢的功能
import pyautogui
import pyperclip
try:
with open ("d:/aaa.txt","r",encoding='utf8') as file:
file=file.readlines()
for L in file:
pyperclip.copy(L.strip()) # L.strip() #刪除頭尾空格
pyautogui.click((175,48))
pyautogui.time.sleep(2.0)
pyautogui.hotkey('ctrl','a')
pyautogui.time.sleep(2.0)
pyautogui.hotkey('ctrl','v')
pyautogui.hotkey('enter')
except:print("error")