当在Python中工作时(例如运行一个脚本),我怎样才能找到脚本所在的git仓库根目录的路径?
到目前为止,我知道我可以通过以下方式获得当前的路径。
path_to_containing_folder = os.path.dirname(os.path.realpath(__file__))
那我怎么才能找到git仓库的位置呢?
|
|
严肃的麻辣香锅 · Python ...· 1 月前 · |
|
|
怕老婆的帽子 · python中的subprocess.Pop ...· 1 月前 · |
|
|
温文尔雅的青蛙 · python subprocess模块详解 ...· 1 周前 · |
|
|
仗义的电脑桌 · 在Deepin系统下安装Qt6 - ...· 1 年前 · |
|
|
玩足球的莴苣 · 女人不断的试探婚姻底线,隔着屏幕都想打她 ...· 1 年前 · |
|
|
想旅行的凉面 · PostgreSQL Table ...· 2 年前 · |
|
|
想出国的皮蛋 · opencv_python使用cv2.imr ...· 2 年前 · |