时间:2021-01-15 11:16:30 | 栏目:Python代码 | 点击:次
实例如下:
import os if __name__ == "__main__": file_path = 'D:/test/test.apk' parent_path = os.path.dirname(file_path) print('parent_path = %s' % parent_path) file_name = os.path.split(file_path)[-1] print('file_name = %s' % file_name)
输出: