获取文件路径的最后一级

import os
filename='./data/train'
os.path.split(filename)[-1]

猜你喜欢

转载自blog.csdn.net/qq_36854740/article/details/107577399
今日推荐