代码如下:
import os
from pathlib import Path
thisDir = Path("C:/Users/91883/Downloads/Telegram Desktop")
for r, d, f in os.walk(thisDir):
for file in f:
if file.endswith('mkv'):
arg = os.path.join(Path("C:/Program Files/MKVToolNix/mkvpropedit.exe"), Path(f' {thisDir}/{file} -e info -s title=""'))
os.popen(arg)基本上,我想运行这个cmd:
"C:\Program Files\MKVToolNix\mkvpropedit.exe" "C:\Users\91883\Downloads\Telegram Desktop\file.mkv" -e info -s title=""
发布于 2020-05-12 12:21:53
为了使用Python运行命令,可以使用这个os.system()函数。
os.system("Enter your command here.")https://stackoverflow.com/questions/61743729
复制相似问题