system programign

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Sat Jul 29 11:53:58 EDT 2006


In <1154187469.197018.295030 at p79g2000cwp.googlegroups.com>, oqestra wrote:

> may i use python to read a file and output its content to another file
> which is not created yet and i don't want to use ">" to do this in
> linux?

Read the documentation about `open()`.  Simple example:

in_file = open('old.txt', 'r')
out_file = open('new.txt', 'w')
for line in in_file:
    out_file.write(line)
in_file.close()
out_file.close()

how do you do ?

I'm fine, thanks.  ;-)

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list