返回path最后的文件名.如果path以/或\结尾,那么就会返回空值.即os.path.split(path)的第二个元素. >>> import os >>> path = '/Users/beazley/Data/data.csv' >>> # Get the last component of the path >>> os.path.basename(path) 'data.csv'…
os.path - Common pathname manipulations操作 This module implements some useful functions on pathnames. To read or write files see open(), and for accessing the filesystem see the os module. The path parameters can be passed as either strings, or bytes.…