str.rsplit()
path = '/home/upload/20190610_14:50:35.154898/yansezhuanhuanf_0_result.html'
path.rsplit('/', 2)
Out[49]:
['/home/upload',
'20190610_14:50:35.154898',
'yansezhuanhuanf_0_result.html']
path = '/home/upload/20190610_14:50:35.154898/yansezhuanhuanf_0_result.html'
path.rsplit('/', 3)
Out[50]:
['/home',
'upload',
'20190610_14:50:35.154898',
'yansezhuanhuanf_0_result.html']
path = '/home/upload/20190610_14:50:35.154898/yansezhuanhuanf_0_result.html'
'/'.join(path.rsplit('/', 2)[1:])
Out[51]:
'20190610_14:50:35.154898/yansezhuanhuanf_0_result.html'
path = '/home/upload/20190610_14:50:35.154898/yansezhuanhuanf_0_result.html'
path.rsplit('/', -1)
Out[42]:
['',
'home',
'upload',
'20190610_14:50:35.154898',
'yansezhuanhuanf_0_result.html']