Message299645
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'
>>> |
|
Date |
User |
Action |
Args |
2017-08-02 07:25:45 | 007hengxyx | set | recipients:
+ 007hengxyx, paul.moore, tim.golden, zach.ware, steve.dower |
2017-08-02 07:25:45 | 007hengxyx | set | messageid: <1501658745.81.0.821961109576.issue31101@psf.upfronthosting.co.za> |
2017-08-02 07:25:45 | 007hengxyx | link | issue31101 messages |
2017-08-02 07:25:45 | 007hengxyx | create | |
|