Alessandro wrote:
I closed and restarted the python console. Now this code (with added
"Nfile.close()" at the end) seems to work properly:
linestring = open(path, 'r').read()
i=linestring.index("*NODE")
i=linestring.index("E",i)
e=linestring.index("*",i+10)
textN = linestring[i+2:e-1]
Nfile =
On May 25, 10:58 am, John Machin wrote:
> On May 25, 6:30 pm, Alessandro wrote:
>
>
>
> > On May 25, 8:38 am, Peter Otten <__pete...@web.de> wrote:
>
> > > Alexzive wrote:
> > > > I am a newby with python. I wrote the following code to extract a text
> > > > from a file and write it to another fi
On May 25, 6:30 pm, Alessandro wrote:
> On May 25, 8:38 am, Peter Otten <__pete...@web.de> wrote:
>
>
>
> > Alexzive wrote:
> > > I am a newby with python. I wrote the following code to extract a text
> > > from a file and write it to another file:
>
> > > linestring = open(path, 'r').read() #read
Alessandro wrote:
> - until now, the only solution which works is to repeat the code while
> the file is still open, which means a quite redundant code:
>
> linestring = open(path, 'r').read()
> i=linestring.index("*NODE")
> i=linestring.index("E",i)
> e=linestring.index("*",i+10)
> textN = lines
On May 25, 8:38 am, Peter Otten <__pete...@web.de> wrote:
> Alexzive wrote:
> > I am a newby with python. I wrote the following code to extract a text
> > from a file and write it to another file:
>
> > linestring = open(path, 'r').read() #read all the inp file in
> > linestring
>
> > i=linestring.
Alexzive wrote:
> I am a newby with python. I wrote the following code to extract a text
> from a file and write it to another file:
>
> linestring = open(path, 'r').read() #read all the inp file in
> linestring
>
> i=linestring.index("*NODE")
> i=linestring.index("E",i)
> e=linestring.index("*"
Alexzive wrote:
Hello,
I am a newby with python. I wrote the following code to extract a text
from a file and write it to another file:
linestring = open(path, 'r').read() #read all the inp file in
linestring
i=linestring.index("*NODE")
i=linestring.index("E",i)
e=linestring.index("*",i+10)
tex
On Sun, 24 May 2009 19:46:01 +0100, Alexzive
wrote:
Hello,
I am a newby with python. I wrote the following code to extract a text
from a file and write it to another file:
linestring = open(path, 'r').read() #read all the inp file in
linestring
i=linestring.index("*NODE")
i=linestring.index
On Sun, May 24, 2009 at 2:46 PM, Alexzive wrote:
> Hello,
> I am a newby with python. I wrote the following code to extract a text
> from a file and write it to another file:
>
> linestring = open(path, 'r').read() #read all the inp file in
> linestring
>
> i=linestring.index("*NODE")
> i=linestr