Path('/home/stephen/shenjianlin') PosixPath('/home/stephen/shenjianlin') Path('/home/stephen/shenjianlin').parent PosixPath('/home/stephen') 这里我要的是路径 怎么有 PosixPath 这种东西出来?难道要正则处理?
1
matrix273 2018 年 9 月 2 日 via Android
str(Path())
Path().stem Path().name |
2
HelloAmadeus 2018 年 9 月 2 日
因为你在 posix 兼容的系统啊, Path 类是一个接口, posixpath 类是具体实现, 你用就行了
|
3
inframe 2018 年 9 月 2 日 via Android
读一读 官方的帮助文档
写得很清楚的 |