Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Dennis Lee Bieber Newsgroups: comp.lang.python Subject: Re: Python path and append Date: Tue, 26 Apr 2016 19:56:09 -0400 Organization: IISS Elusive Unicorn Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de upTF2Cmpe69awrp4n6ZlFwg4XPesCjoOoLAswCItMp5g== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'append': 0.07; "'w')": 0.09; 'implied,': 0.09; 'message- id:@4ax.com': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'file,': 0.15; '"a")': 0.16; "'r')": 0.16; '2016': 0.16; 'f.read()': 0.16; 'need:': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'skip:> 20': 0.16; 'url:home': 0.18; 'file:': 0.22; 'header:X-Complaints- To:1': 0.26; 'appending': 0.29; 'code': 0.30; 'another': 0.32; 'michael': 0.33; 'tue,': 0.34; 'skip:> 10': 0.35; 'to:addr:python- list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'charset :us-ascii': 0.37; 'end': 0.39; 'to:addr:python.org': 0.40; 'space': 0.40; 'entire': 0.61; '>if': 0.84; 'asterisk': 0.84; 'dennis': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: adsl-108-79-218-66.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: Xref: csiph.com comp.lang.python:107693 On Tue, 26 Apr 2016 19:16:56 +0100, Michael declaimed the following: >If you want to read an entire file, append a space and asterisk and write it to another file, this is the code you need: > >infile = open('win.txt', 'r') >text = f.read() >infile.close() >text += " *" >outfile = open('outfile.txt', 'w') >outfile.write(text) >outfile.close() > If appending a " *" to the very end of the file, and as implied, it be the same file: fup = open("theFile.txt", "a") fup.write(" *") fup.close() -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/