使用命令: python -m site python -m site --user-site 注意当查看指定版本的python的安装包时,需要指定python版本,比如python2.7.15 -m site 参考:https://stackoverflow.com/questions/122327/how-do-i-find-the-location-of-my-python-site-packages-directory
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=\'
获取目录路径和文件路径 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
site " This module is automatically imported during initialization. The automatic import can be suppressed using the interpreter’s -S option. Importing this module will append site-specific paths to the module search path and add a few builtins. &quo