The python project startup path is automatically added

import them

import sys

base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) #Find the path of the project of the current project

print (base_dir)

sys.path.append(base_dir) #Import the path of the found project into the current system path

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325118759&siteId=291194637