M
martijn
I'm testing some writing/reading with a file and i'm not sure if it is
possible to print/use the line with fileinput.input inplace=1 (see
below)
import fileinput
thefile = fileinput.input('bla.txt',inplace=1,backup='.bak')
for line in thefile:
if line != "1\n":
print line,
#is it possible to 'use' / print the 'line' on the screen here?
thefile.close()
When its not possible then I use 2 file's filein.txt,fileout.txt
Thanks,
GC-Martijn
possible to print/use the line with fileinput.input inplace=1 (see
below)
import fileinput
thefile = fileinput.input('bla.txt',inplace=1,backup='.bak')
for line in thefile:
if line != "1\n":
print line,
#is it possible to 'use' / print the 'line' on the screen here?
thefile.close()
When its not possible then I use 2 file's filein.txt,fileout.txt
Thanks,
GC-Martijn