newbe how to read in a string?

Emile van Sebille emile at fenx.com
Fri Mar 23 08:34:38 EST 2001


Here, it looks like you're dealing with comma separated fields.

strFields = a.split(",")
thirdField = strFields[2]

HTH
--

Emile van Sebille
emile at fenx.com

---------
"William Famy" <william.famy at noos.fr> wrote in message
news:3ABB4E70.54885C9F at noos.fr...
> Hi.
>
> I am looking how to read in a string.
>
> Ex
> a='2000/12/28,24.3,87.1,65.4'
>
> I whant to extract the 87.1. In C i would code by a
> scanf("%s,%f,%f,%f\n"),...
>
> How can i do this in python?
>
> Thanks for answer.
>
> --
>        \\\|///
>                            \\  - -  //
>                             (  @ @  )
> +-------------------------oOOo-(_)-oOOo-------------------------+
> |  Famy William  36 avenue des barattes  74000 Annecy  France   |
> |  email:william.famy at noos.fr william.famy at mail-enseignant.com  |
> +---------------------------------Oooo--------------------------+
>                            oooO   (   )
>                           (   )    ) /
>                            \ (    (_/
>                             \_)





More information about the Python-list mailing list