Hi All,
I have another question about formatted input. Suppose I am reading a
text file, and that I want it to be something like this
word11 = num11, word12 = num12, word13 = num13 etc...
word21 = num21, word22 = num12, word23 = num23 etc...
etc...
where wordx1 belongs to a certain dictionary
Bob roberto.pagli...@gmail.com writes:
Hi All,
I have another question about formatted input. Suppose I am reading a
text file, and that I want it to be something like this
word11 = num11, word12 = num12, word13 = num13 etc...
word21 = num21, word22 = num12, word23 = num23 etc...
etc
Bob (roberto.pagli...@gmail.com) wrote:
Hi All,
I have another question about formatted input. Suppose I am reading a
text file, and that I want it to be something like this
word11 = num11, word12 = num12, word13 = num13 etc...
word21 = num21, word22 = num12, word23 = num23 etc...
etc
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);
On Sat, Sep 5, 2009 at 3:13 AM, candidecand...@free.invalid 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
Chris Rebert wrote:
On Sat, Sep 5, 2009 at 3:13 AM, candidecand...@free.invalid 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
candide cand...@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 ?
RTFM! :)
In the python 2.5 manual: Chapter 4.2.6 (search pattern 'scanf' on the
index tab of python25.chm)
There are
On Sat, Sep 5, 2009 at 8:00 AM, Terry Reedytjre...@udel.edu wrote:
Chris Rebert wrote:
On Sat, Sep 5, 2009 at 3:13 AM, candidecand...@free.invalid 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
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
Deep wrote:
Hi all,
I am a newbie to python
I have an input of form
one number space another number
ie.
4 3
how can i assign these numbers to my variables??
Or with list comprehension:
n1, n2 = [int(n) for n in raw_input().split()]
Neither of these methods checks for errors (e.g.
Hi all,
I am a newbie to python
I have an input of form
one number space another number
ie.
4 3
how can i assign this to my variables??
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
I am a newbie to python
I have an input of form
one number space another number
ie.
4 3
how can i assign these numbers to my variables??
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 10, 1:29 pm, Deep [EMAIL PROTECTED] wrote:
Hi all,
I am a newbie to python
I have an input of form
one number space another number
ie.
4 3
how can i assign these numbers to my variables??
n1, n2 = map(int, raw_input().split())
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 10, 11:28 am, Deep [EMAIL PROTECTED] wrote:
Hi all,
I am a newbie to python
I have an input of form
one number space another number
ie.
4 3
how can i assign this to my variables??
Hi,
you could use:
aux = f.readline() # read a line from your input file
new_aux = string.split(aux,
14 matches
Mail list logo