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