os.path.abspath(path)
输入相对路径,返回绝对路径
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import os
>>> print(os.path.abspath("."))
C:\Users\28914\AppData\Local\Programs\Python\Python37
os.path.basename(path)
返回路径最后的文件或目录名,单纯的字符串处理,不会管该路径是否存在
>>