小可愛,加油噻~
添加上級目錄
import sys sys.append('../..')
這樣 from ... import 就會把加入的路徑要掃描噠
os.walk() 方法用於通過在目錄樹中游走輸出在目錄中的文件名,向上或者向下。
os.walk() 方法是一個簡單易用的文件、目錄遍歷器,可以幫助我們高效的處理文件、目錄方面的事情。
from PIL import image
image.getcolors : 在 1.1.5 版本中新添加的。返回一個未排序列表,其元素是元組(count, color)。the count is the number of times the corresponding color occurs in the image 。If the maxcolors value is exceeded, the method stops counting and returns None。
填坑啦:
之前一直沒寫,今天正式填坑。
附代碼:
數據截圖:
參考:
https://www.jianshu.com/p/bbad16822eab