我的问题太简单了。但是我不知道要使用的术语,因此可能无法在stackoverflow上找到答案。str.replace“”到“/”
我使用Python 2.7
我需要知道如何将此路径转换,
E:\Documents and Settings\Admin\Desktop\new.html
这个路径
E:/Documents and Settings/Admin/Desktop/new.html
而且,如果你能请编辑我的主题行以便让其他人轻松找到答案。
在此先感谢并道歉,如果这是一个重复的问题。
试试http://www.tutorialspoint.com/python/string_replace.htm – fuesika 2014-08-29 15:24:55
你到底在问什么?你需要一个正则表达式吗?请解释你正在尝试做什么。 – MattDMo 2014-08-29 15:24:57
@MattDMo当我尝试使用此路径打开文件时 - E:\ Documents and Settings \ Admin \ Desktop \ new.html它说无效路径...我因为只有在使用“/”时才会找到文件“\”...我正在寻找将“\”转换为“/”。顺便问下你的问题? – 2014-08-29 15:26:22