Re: Formatted input function

2009-09-05 Thread candide
Günther Dietrich a écrit : > > RTFM! :) > > In the python 2.5 manual: Chapter 4.2.6 (search pattern 'scanf' on the > index tab of python25.chm) Correct !! For once ;) the Manual gives an inambiguous answer : -- Simulating scanf() .-- Python does not currently have an equ

Re: Formatted input function

2009-09-05 Thread Chris Rebert
On Sat, Sep 5, 2009 at 8:00 AM, Terry Reedy wrote: > Chris Rebert wrote: >> >> On Sat, Sep 5, 2009 at 3:13 AM, candide wrote: >>> >>> I have a text file and the first line provides the best score of a game. >>> This >>> line has  the following format : >>> >>> Best score : 42 >>> >>> In order to up

Re: Formatted input function

2009-09-05 Thread Günther Dietrich
candide wrote: >In C, we would manage this with the following statement : > >fscanf(foo_file, "Best score : %d", &score); > >Does Python provide an equivalent ? RTFM! :) In the python 2.5 manual: Chapter 4.2.6 (search pattern 'scanf' on the index tab of python25.chm) There are some scanf-pat

Re: Formatted input function

2009-09-05 Thread Terry Reedy
Chris Rebert wrote: On Sat, Sep 5, 2009 at 3:13 AM, candide wrote: I have a text file and the first line provides the best score of a game. This line has the following format : Best score : 42 In order to update the score, I try to retrieve the score value. In C, we would manage this with th

Re: Formatted input function

2009-09-05 Thread Chris Rebert
On Sat, Sep 5, 2009 at 3:13 AM, candide wrote: > I have a text file and the first line provides the best score of a game. This > line has  the following format : > > Best score : 42 > > In order to update the score, I try to retrieve the score value. > > In C, we would manage this with the followin

Formatted input function

2009-09-05 Thread candide
I have a text file and the first line provides the best score of a game. This line has the following format : Best score : 42 In order to update the score, I try to retrieve the score value. In C, we would manage this with the following statement : fscanf(foo_file, "Best score : %d", &score);