刪除 谷歌瀏覽器緩存

import os
import shutil

def mv_dir():
    delList = []
    delDir = b"C:\Users\Administrator\AppData\Local\Google\Chrome\User Data"
    delList = os.listdir(delDir)
    for f in delList:
        filePath = os.path.join(delDir, f)
        if os.path.isfile(filePath):
            os.remove(filePath)
        elif os.path.isdir(filePath):
            shutil.rmtree(filePath, True)

if __name__ == '__main__':
    mv_dir()
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章