mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-26 00:53:54 +08:00
clone时修改项目名,也能正确找到项目根目录
This commit is contained in:
+2
-3
@@ -5,9 +5,8 @@ import socket
|
|||||||
|
|
||||||
|
|
||||||
def get_project_dir():
|
def get_project_dir():
|
||||||
projectName = 'xiaozhi-esp32-server'
|
"""获取项目根目录"""
|
||||||
filePath = os.path.abspath(__file__)
|
return os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))+'/'
|
||||||
return filePath[:filePath.rfind('/' + projectName + '/') + len(projectName) + 2]
|
|
||||||
|
|
||||||
|
|
||||||
def get_local_ip():
|
def get_local_ip():
|
||||||
|
|||||||
Reference in New Issue
Block a user