"""获取当前目录""" 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(),"../..")))
python cmd 查看当前路径
最新推荐文章于 2024-10-14 09:24:30 发布