Dumb Q #1

Norm norm at norm.com
Mon Jan 27 23:17:58 EST 2003


I should have mentioned that I tried "199" as well.  No luck no error.

Am I opening the file in the correct mode  r+   ?


"Grant Edwards" <grante at visi.com> wrote in message
news:slrnb3c0lg.b4r.grante at localhost.localdomain...
> In article <3e35fde8_3 at corp.newsgroups.com>, Norm wrote:
> > I would like to open this unix passwd file and chang the GID of those
who
> > have a GID of 200 to 199
> >
> > This does everything except change fields[3] to 199
>
> > for record in records:
> >     fields = record.split(':')
> >     if fields[3] == "200":
> >         print fields[0], " has a GID of 200"
> >         print "now changing it to 199"
> >         fields[3] = 199
>
> You probably want
>
>           fields[3] = "199"
>
> > file.close()
>
> --
> Grant Edwards                   grante             Yow!  Can I have an
IMPULSE
>                                   at               ITEM instead?
>                                visi.com




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----




More information about the Python-list mailing list