Processing on a string

Jay Collins jcollin at exis.net
Mon Feb 5 16:22:30 EST 2001


Hello,

 I'm trying to do the following:

I have a list that is all the lines from the password file.

if I did print p[0] # p being a line in /etc/passwd
I would get:

uucp:x:10:14:uucp:/var/spool/uucp:

or whatever. My question is how do process this list into another
list with just everything before the first ":". I'm not quite sure how to
do this. 




More information about the Python-list mailing list