0

I am receiving an error message about No such file or directory for my python code. I save the file on my desktop computer. But I am receiving the error message

 #!/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 Answers1

0

I think you need to use backslashes in windows. Try changing to C:\\Users\\***\\Desktop\\IP Data

Saksham Varma
  • 2,122
  • 13
  • 15