Re: [newbie] problem with data (different behaviour between batch and interactive use)

2012-06-27 Thread Justin Barber
When you are reading it in measurement is a string. The indicies of the string are going to be returned in your print statements. Similar to having done this in the interpreter: In [17]: measurement = '+3.874693E01,+9.999889E03,+9.91E+37,+1.876595E+04,+3.994000E+04' In [18]: measurement[1]

Re: [newbie] problem with data (different behaviour between batch and interactive use)

2012-06-27 Thread Cousin Stanley
Jean Dupont wrote: > I have some data which is presented > in the following format to me : > > +3.874693E-01,+9.999889E-03,+9.91E+37,+1.876595E+04,+3.994000E+04 > > I'm only interested in the first two fields i.e. > > +3.874693E-01,+9.999889E-03 > The following program will read line

Re: [newbie] problem with data (different behaviour between batch and interactive use)

2012-06-27 Thread Jussi Piitulainen
Jean Dupont writes: > If I start python interactively I can separate the fields as > follows: > >measurement=+3.874693E01,+9.999889E03,+9.91E+37,+1.876[...] > >print measurement[0] > 0.3874693 [...] > The script does this: > measurement=serkeith.readline().replace('\x11','').replace([...] > pr

[newbie] problem with data (different behaviour between batch and interactive use)

2012-06-27 Thread Jean Dupont
I have some data which is presented in the following format to me: +3.874693E-01,+9.999889E-03,+9.91E+37,+1.876595E+04,+3.994000E+04 I'm only interested in the first two fields i.e. +3.874693E-01,+9.999889E-03 If I start python interactively I can separate the fields as follows: >measurement=+3