system programign

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • oqestra@yahoo.com

    #1

    system programign

    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? how do you do ? oqestra.

  • Marc 'BlackJack' Rintsch

    #2
    Re: system programign

    In <1154187469.197 018.295030@p79g 2000cwp.googleg roups.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

    Comment

    Working...