Formatted input function
gd_usenet at spamfence.net
Sat Sep 5 19:50:18 CEST 2009
candide <candide at free.invalid> wrote:
>In C, we would manage this with the following statement :
>fscanf(foo_file, "Best score : %d", &score);
>Does Python provide an equivalent ?
In the python 2.5 manual: Chapter 4.2.6 (search pattern 'scanf' on the
index tab of python25.chm)
There are some scanf-patterns with corresponding regular expressions
Works quite nice.
More information about the Python-list