20180130之PYTHON學習筆記【PYTHON3寫個自動聽課功能】

-----------------------原始實現想法------------python

import pyautogui
from PIL import Image
#img=Image.open('c:/python36/SOURCES/A.png')
#img2=Image.open('c:/python36/SOURCES/TJ.png')
pyautogui.click(pyautogui.center(pyautogui.locateOnScreen('c:/python36/SOURCES/A.png')))
pyautogui.click(pyautogui.center(pyautogui.locateOnScreen('c:/python36/SOURCES/TJ.png')))
pyautogui.click(pyautogui.center(pyautogui.locateOnScreen('c:/python36/SOURCES/JX.png')))ui

 

------------流程改進------------------import

import pyautogui
from PIL import Image
pyautogui.click(pyautogui.center(pyautogui.locateOnScreen('c:/python36/SOURCES/SMXGWY.png')))
pyautogui.click(pyautogui.center(pyautogui.locateOnScreen('c:/python36/SOURCES/A.png')))
pyautogui.click(pyautogui.center(pyautogui.locateOnScreen('c:/python36/SOURCES/TJ.png')))
pd=pyautogui.locateOnScreen('c:/python36/SOURCES/HDZQ.png')
if pd != None:
pyautogui.click(pyautogui.center(pyautogui.locateOnScreen('c:/python36/SOURCES/JX.png'))

#pyautogui.click(pyautogui.center(pyautogui.locateOnScreen('c:/python36/SOURCES/HDZQ.png')))
)gui

 

-----------------------------------------cli

相關文章
相關標籤/搜索