Folks,
I am trying to enter names in a file; each on a new line with this code, but not working:
done = 0
while not done:
str = raw_input("Enter login name:\t to quit type 'q': ")
if str == 'q':
done = 1
else:
str = raw_input("Enter login name:\t to quit type 'q': ")
if str == 'q':
done = 1
else:
str = str + '\n'
fd.write(str)
The traceback is as under:
Traceback (most recent call last):
File "scrap.py", line 38, in ?
fd.write(str)
IOError: (0, 'Error')
File "scrap.py", line 38, in ?
fd.write(str)
IOError: (0, 'Error')
Please help to rectify this error...
--
To HIM you shall return.
--
To HIM you shall return.
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor