def remove_all_file(filepath, file_name):
"""
删除 MAC 临时文件
:param file_name:
:return:
"""
for root, dirs, files in os.walk(filepath):
for name in files:
print(name)
if name.startswith("._") or name == file_name:
os.remove(os.path.join(root, name))
接着,我们利用pyinstaller将Python文件打包成Exe可执行文件。 0 l5 m% G2 U V
# 安装 pyinstaller ' d5 f* |+ |0 T3 Z$ v
pip3 install pyinstaller 9 _3 U( K1 k% e" H8 k' w+ P- E
# 把 py 文件打包成 exe 可执行文件 s5 H/ j- {' I, j# 图标:img.ico) O5 L5 o& y; `" w. q1 s
pyinstaller -F -i img.ico del_mac_files.py