获取目录路径和文件路径 import osfor root, dirs, files in os.walk(".", topdown=False): # ‘.’为获取脚本所在路径下的同级文件及目录路径,‘..’则获取脚本所在路径上一级文件及目录路径for name in files:print(os.path.join(root, name)) for name in dirs:print(os.path.join(root, name)) import osfor root, dir…
python获取当前文件路径 学习了:https://www.cnblogs.com/strongYaYa/p/7200357.html https://blog.csdn.net/heatdeath/article/details/78070832 https://www.cnblogs.com/WonderHow/p/4403727.html import os print(os.getcwd()) # for root, dirs, files in os.walk(os.getcwd()…
bat wmic python 获取进程的所在路径 doc: wmic process where name="process-name" get executablepath wmic process where "name like '%chrome%'" get processid,commandline /format:list python: import subprocess cmd = 'wmic process where "name=\'…