
python
import os
import shutil
import subprocess
def clear_cache():
获取当前日期,用于生成清理缓存的命令
current_date = datetime.datetime.now().strftime('%Y-%m-%d')
构建清理缓存的命令
command = f'rm -rf {current_date}/*'
执行命令
subprocess.run(command, shell=True)
if __name__ == '__main__':
clear_cache()
将以上代码保存为一个`.py`文件,然后运行该脚本即可自动清理谷歌浏览器的缓存文件。请注意,此脚本仅适用于Windows系统。



