Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #38582 > unrolled thread
| Started by | David Hutto <dwightdhutto@gmail.com> |
|---|---|
| First post | 2013-02-10 11:46 -0500 |
| Last post | 2013-02-10 11:46 -0500 |
| 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: Any idea how i can format my output file with ********************Start file*********************** usinf Python 2.7 David Hutto <dwightdhutto@gmail.com> - 2013-02-10 11:46 -0500
| From | David Hutto <dwightdhutto@gmail.com> |
|---|---|
| Date | 2013-02-10 11:46 -0500 |
| Subject | Re: Any idea how i can format my output file with ********************Start file*********************** usinf Python 2.7 |
| Message-ID | <mailman.1588.1360514788.2939.python-list@python.org> |
Here is the full function with an instance using the function:
def text_wrapper(file_name = None, pre_text = None, text = None,
post_text = None):
f = open(file_name, 'a')
f.write("%s\n%s\n%s\n" % (pre_text, text, post_text))
f.close()
text_wrapper(file_name = r"/home/david/file_doc.doc", pre_text =
"***Start File***", text = "Some data here.", post_text = "***End
File***")
Back to top | Article view | comp.lang.python
csiph-web