20180130之PYTHON学习笔记【PYTHON3写个自动听课功能】
-----------------------原始实现想法------------
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')))
------------流程改进------------------
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')))
)
-----------------------------------------