split和join函数的使用

#coding=utf-8

path = 'D:/mylinux/mxnet-ssd/result/tmp/'
tmp = path.split('/')
print(tmp)
tmppath = tmp[:-2]
tmppath = '/'.join(tmppath)
print(tmppath)

猜你喜欢

转载自blog.csdn.net/tony2278/article/details/83748802