Dumb Q #1

Grant Edwards grante at visi.com
Mon Jan 27 23:04:53 EST 2003


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            




More information about the Python-list mailing list