Python - Get path of root project structure

后端 未结 16 1838
陌清茗
陌清茗 2020-12-04 08:03

I\'ve got a python project with a configuration file in the project root. The configuration file needs to be accessed in a few different files throughout the project.

16条回答
  •  甜味超标
    2020-12-04 08:45

    Below Code Returns the path until your project root

    import sys
    print(sys.path[1])
    

提交回复
热议问题