当在Python中工作时(例如运行一个脚本),我怎样才能找到脚本所在的git仓库根目录的路径?
到目前为止,我知道我可以通过以下方式获得当前的路径。
path_to_containing_folder = os.path.dirname(os.path.realpath(__file__))
那我怎么才能找到git仓库的位置呢?
|
|
爱健身的芒果 · python截取文件名后三位_mob64ca ...· 1 年前 · |
|
|
踏实的刺猬 · vue.js - nuxt.js ...· 2 年前 · |
|
|
粗眉毛的青蛙 · 航线地图上的动画飞行效果怎么实现?只要五步轻 ...· 2 年前 · |
|
|
腼腆的蚂蚁 · Log4j.properties配置详解 ...· 3 年前 · |