View Single Post
Old 04-26-2006, 03:20 PM   #9 (permalink)
coolman
Registered User
 
Join Date: Mar 2006
Posts: 25
coolman is on a distinguished road
sorry it still dont work

Python24 is a directory and student is a text file and i am trying to read in that file but its not working. so the pathway is just wrong any ideas

Code:
f = open('Python24/Student')
lines = f.readlines()
for line in lines:
      line_head = line[0:6]
     line_tail = line[6:-1]
     print "Line Head: " + line_head
     print "Line Tail: " + line_tail
Traceback (most recent call last):
File "<pyshell#0>", line 1, in -toplevel-
f = open('Python24/Student')
IOError: [Errno 2] No such file or directory: 'Python24/Student'
coolman is offline   Reply With Quote