Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #107693 > unrolled thread
| Started by | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| First post | 2016-04-26 19:56 -0400 |
| Last post | 2016-04-26 19:56 -0400 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Python path and append Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-04-26 19:56 -0400
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Date | 2016-04-26 19:56 -0400 |
| Subject | Re: Python path and append |
| Message-ID | <mailman.132.1461714976.32212.python-list@python.org> |
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 top | Article view | comp.lang.python
csiph-web