Message299645
| Author |
007hengxyx |
| Recipients |
007hengxyx, paul.moore, steve.dower, tim.golden, zach.ware |
| Date |
2017年08月02日.07:25:45 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1501658745.81.0.821961109576.issue31101@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I need to remove a file in python at Windows2012R2, but, os.remove()auto add \ in each seq.
code:
#coding=utf-8
import os
dir_path='d:\c\d\e\t\c\t.xf'
os.remove(dir_path)
result:
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
Traceback (most recent call last):
File "D:\test\script\test.py", line 4, in <module>
os.remove(dir_path)
WindowsError: [Error 3] The system cannot find the path specified: 'd:\\c\\d\\e\t\\c\t.xf'
>>> |
|