1. 驗證碼用到tesseract,但沒有python3.7版本的tesserocr,無奈之下找到pytesseract,使用過程出現波折,參考博客http://www.javashuo.com/article/p-yoatuqeq-eo.html裏面的方法,環境變量也修改了,仍是報錯,最後發現是config沒整好,在代碼中添加變量參數以下,結果就識別了,再看看pytesseract的代碼,修改了下博客中提到的這兩個代碼,就能夠不用每次都再從新修改代碼了,開森~python
import pytesseract from PIL import Image pytesseract.pytesseract.tesseract_cmd = 'D:/xxx/Tesseract-OCR/tesseract.exe' tessdata_dir_config = '--tessdata-dir "D:/xxx/Tesseract-OCR/tessdata"' image = Image.open("code.png") code = pytesseract.image_to_string(image, config=tessdata_dir_config) print(code)
2. flask 一直出錯,老是出現warning:Do not use the development server in a production environment.
Use a production WSGI server instead. 剛剛看到一個網友說把計算機名改一下就行了,就行了,好了,了flask