python根据\切割"C:\Users\xupenghui\Desktop\server.log",并输出
时间: 2023-04-09 15:03:14 浏览: 65
可以使用以下代码实现:
```
path = "C:\\Users\\xupenghui\\Desktop\\server.log"
split_path = path.split("\\")
print(split_path)
```
输出结果为:
```
['C:', 'Users', 'xupenghui', 'Desktop', 'server.log']
```
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)