Python:没有这样的文件或目录

时间:2015-04-05 19:16:13

标签: python

我收到一条关于我的python代码没有这样的文件或目录的错误消息。我将文件保存在台式计算机上。但是我收到了错误消息

 #!/usr/bin/python
fh=open("C:/Users/****/Desktop/IP Data","r")
for line in fh.readlines():
        line = line.strip()
        words = line.split()
# increase counters
for word in words: 
            if len(words)>3:
                if "IP" in words[1]:
                    print '%s\t%s' % (words[2],1)

1 个答案:

答案 0 :(得分:0)

我认为你需要在windows中使用反斜杠。尝试更改为C:\\Users\\***\\Desktop\\IP Data

相关问题