[Tutor] small program, but I'm very confused

Bob Gailer ramrom@earthling.net
Tue Nov 5 16:29:03 2002


At 02:58 PM 11/5/2002 -0600, Melissa K. Surprenant wrote:

>Yes, that part will run (I pasted it into a separate file).  I'm telnetting
>into a unix machine, so I changed the file path to the following:
>
>f=open('/tmp/listofusers', 'w')
>f=open('/tmp/listofusers, 'r+')
>f.write('\2\n')

Well then I suggest adding pieces of code, perhaps one line at a time until 
you get the error, or, if it's like my experience, suddenly things will 
work just fine.

Also it's superfluous to close f (as you did in your original code). 
Reassigning f closes the file as part of deleting the original instance. 
Also it's superfluous to f=open('/tmp/listofusers, 'r+'), as the original 
open accomplishes the same thing.

Bob Gailer
170 Forsythe Rd
Nederland CO 80466
303-442-2625