1 #author F 2 3 import os 4 import sys 5 print(__file__) #相对路径 6 print(os.path.abspath(__file__)) #绝对路径 7 print(os.path.dirname(os.path.abspath(__file__))) 8 print(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 9 BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 10 11 sys.path.append(BASE_PATH) 12 from conf import settings 13 from core import main 14 main.sayHello()
时间: 2024-10-08 23:43:36