当在Python中工作时(例如运行一个脚本),我怎样才能找到脚本所在的git仓库根目录的路径?
到目前为止,我知道我可以通过以下方式获得当前的路径。
path_to_containing_folder = os.path.dirname(os.path.realpath(__file__))
那我怎么才能找到git仓库的位置呢?
![]() |
逼格高的凉面 · Pytorch:生成随机数Tensor的方法 ...· 10 月前 · |
![]() |
八块腹肌的小蝌蚪 · MongoDb驱动c#查询优化_webrtc ...· 1 年前 · |
![]() |
帅呆的板凳 · antd-select选择框联动(后台数据) ...· 1 年前 · |
![]() |
快乐的大蒜 · CSS自动换行后缩进_前端两行的时候 ...· 1 年前 · |