os.path.dirname(path) 語法:os.path.dirname(path) 功能:去掉文件名,返回目錄 如:print(os.path.dirname("E:/Read_File/read_demo.py"))#結(jié)果:E:/Read_File