path = /home/username/data/text.txt
path.split("/")
["home","username","data","text.txt "]
## 而使用rsplit:
path.rsplit("/",1)
["/home/username/data","text.txt "]
rsplit("/",1) 中的1,表示从后面分割1个出来,如果是2,那么就是分割两部分出来
07-17
5444
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-01
5583
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)