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()
using System.Runtime.InteropServices; var frameworkPath = RuntimeEnvironment.GetRuntimeDirectory(); var cscPath = Path.Combine(frameworkPath, "csc.exe"); Console.WriteLine(frameworkPath); // C:\Windows\Microsoft.NET\Framework\v4.0.30319 Console.
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=\'
获取目录路径和文件路径 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