Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #107693

Re: Python path and append

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Dennis Lee Bieber <wlfraed@ix.netcom.com>
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 <mailman.132.1461714976.32212.python-list@python.org> (permalink)
References <DUB116-W85F8F15123A15716395CA7CA630@phx.gbl> <etvvhbtlo9cev7lmo0q1jsabtjhkce3ofr@4ax.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de upTF2Cmpe69awrp4n6ZlFwg4XPesCjoOoLAswCItMp5g==
Return-Path <python-python-list@m.gmane.org>
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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <etvvhbtlo9cev7lmo0q1jsabtjhkce3ofr@4ax.com>
X-Mailman-Original-References <DUB116-W85F8F15123A15716395CA7CA630@phx.gbl>
Xref csiph.com comp.lang.python:107693

Show key headers only | View raw


On Tue, 26 Apr 2016 19:16:56 +0100, Michael <bigbadmick2000@hotmail.com>
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/

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Python path and append Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-04-26 19:56 -0400

csiph-web