DOS命令 根據進程名稱終止進程
taskkill /T /F /im node.exe
重啟本地執行機
shutdown -r -t 0
解密解壓縮文件
import zipfile
zipFile=zipfile.ZipFile("Joom_Web.zip","r")# //這里是我們的壓縮文件
zipFile.extractall(pwd="ly,12345.")# //這里是我們的密碼
python操作windows文件和目錄
# 移動(剪切)文件到指定目錄
shutil.move(oldname,newfile)
# 復制文件到指定目錄
shutil.copy(oldname,newfile)
# 刪除目錄下所有文件
for file in os.listdir(newfile):#listdir 獲取目錄下所有文件
files=os.path.join(newfile,file)
if os.path.isfile(files):
os.remove(files)
# 獲取文件大小
print os.path.getsize(oldname)
# 獲取文件訪問時間
print os.path.getatime(oldname)
# 獲取文件創建時間
print os.path.getctime(oldname)
print os.stat(oldname).st_ctime
# 獲取文件修改時間
print os.path.getmtime(oldname)
print os.stat(oldname).st_mtime