import os
# 获取路径
print (os.getcwd())
print (os.path.abspath(os.path.dirname(__file__)))
# 获取上一级路径
print (os.path.abspath(os.path.dirname(os.path.dirname(__file__))))
print (os.path.abspath(os.path.dirname(os.getcwd())))
print (os.path.abspath(os.path.join(os.getcwd(), "..")))
# 获取上上级路径
print (os.path.abspath(os.path.join(os.getcwd(), "../..")))