Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Any idea how i can format my output file with********************Start file*********************** usinf Python 2.7

Reply
Thread Tools

Re: Any idea how i can format my output file with********************Start file*********************** usinf Python 2.7

 
 
Morten Engvoldsen
Guest
Posts: n/a
 
      02-10-2013
Hi Dave,
Thanks for your reply with full function Great forum..

On Sun, Feb 10, 2013 at 5:46 PM, David Hutto <(E-Mail Removed)> wrote:

> 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***")
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any idea how i can format my output file with********************Start file*********************** usinf Python 2.7 Morten Engvoldsen Python 2 02-09-2013 07:56 PM
Re: Any idea how i can format my output file with********************Start file*********************** usinf Python 2.7 Dave Angel Python 0 02-09-2013 05:13 PM
Re: Any idea how i can format my output file with********************Start file*********************** usinf Python 2.7 Peter Otten Python 0 02-09-2013 03:01 PM
Re: Any idea how i can format my output file with********************Start file*********************** usinf Python 2.7 D'Arcy J.M. Cain Python 0 02-09-2013 02:38 PM
Re: Any idea how i can format my output file with********************Start file*********************** usinf Python 2.7 Dave Angel Python 0 02-09-2013 02:38 PM



Advertisments