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

2013-02-10 Thread Morten Engvoldsen
Hi, Thanks for your suggestion. This is a great forum for Python. :) On Sun, Feb 10, 2013 at 4:12 PM, inq1ltd inq1...@inqvista.com wrote: ** On Saturday, February 09, 2013 03:27:16 PM Morten Engvoldsen wrote: Hi Team, I Have saved my output in .doc file and want to format the output

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

2013-02-10 Thread inq1ltd
On Saturday, February 09, 2013 03:27:16 PM Morten Engvoldsen wrote: Hi Team, I Have saved my output in .doc file and want to format the output with *Start the File Some data here ***End of File* Can

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

2013-02-10 Thread Morten Engvoldsen
Hi Dave, This is good code, simple but makes the Coding Standard better.. Thanks to all again On Sun, Feb 10, 2013 at 5:01 PM, David Hutto dwightdhu...@gmail.com wrote: Kind of like below: david@david-HP-Compaq-dc7600-Convertible-Minitower:~$ python Python 2.7.3 (default, Aug 1 2012,

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

2013-02-10 Thread David Hutto
I haven't looked at text wrapper, but it would probably look something like this in a function, untested: def text_wrapper(file_name = None, pre_text = None, text = None, post_text = None): f = open(file, 'a') f.write(%s\n%s\n%s\n % (pre_text = None, text, post_text = None) f.close()

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

2013-02-10 Thread David Hutto
Oops, I mean : def text_wrapper(file_name = None, pre_text = None, text = None, post_text = None): f = open(file, 'a') f.write(%s\n%s\n%s\n % (pre_text, text, post_text) f.close() -- http://mail.python.org/mailman/listinfo/python-list

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

2013-02-10 Thread Morten Engvoldsen
Hi Dave, Thanks again for suggestion On Sun, Feb 10, 2013 at 5:30 PM, David Hutto dwightdhu...@gmail.com wrote: I haven't looked at text wrapper, but it would probably look something like this in a function, untested: def text_wrapper(file_name = None, pre_text = None, text = None,

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

2013-02-10 Thread David Hutto
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 =

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

2013-02-10 Thread David Hutto
On Sun, Feb 10, 2013 at 11:45 AM, Morten Engvoldsen mortene...@gmail.com wrote: Hi Dave, Thanks again for suggestion No problem. I haven't used my python skills in a while, so I went ahead and went through it fully. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com --

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

2013-02-10 Thread Morten Engvoldsen
Hi Dave, Thanks for your reply with full function :) Great forum.. :) On Sun, Feb 10, 2013 at 5:46 PM, David Hutto dwightdhu...@gmail.com 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):

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

2013-02-09 Thread Dave Angel
On 02/09/2013 09:27 AM, Morten Engvoldsen wrote: Hi Team, I Have saved my output in .doc file and want to format the output with *Start the File Some data here ***End of File* Can you let me know how can i do

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

2013-02-09 Thread D'Arcy J.M. Cain
On Sat, 9 Feb 2013 15:27:16 +0100 Morten Engvoldsen mortene...@gmail.com wrote: I Have saved my output in .doc file and want to format the output with *Start the File Some data here ***End of File* Can

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

2013-02-09 Thread Morten Engvoldsen
Hi Cain, Thanks for your reply. I am stroning all the contents in batchdate and then, data = base64.encodestring(batchdata) and then writing data in doc file. I know i can append ***Start file*** in the batchdata, but is there a better python code like multiply * into 10

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

2013-02-09 Thread Peter Otten
Morten Engvoldsen wrote: I know i can append ***Start file*** in the batchdata, but is there a better python code like multiply * into 10 times -- any python code i can add the formatting in dynamic way instead of hardcoding with ***Start file*** line.

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

2013-02-09 Thread Morten Engvoldsen
Hi Davea, I am using Python 2.7. -- http://mail.python.org/mailman/listinfo/python-list

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

2013-02-09 Thread rusi
On Feb 9, 7:27 pm, Morten Engvoldsen mortene...@gmail.com wrote: Hi Team, I Have saved my output in .doc file and want to format the output with *Start the File Some data here ***End of File* Can you let me

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

2013-02-09 Thread Dave Angel
On 02/09/2013 10:01 AM, Morten Engvoldsen wrote: Hi Davea, I am using Python 2.7. Sorry, I should have noticed the python version in the subject line, but didn't until this reply. How about print outfile, Start the File.center(55, *) after creating the file, and print outfile, Start

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

2013-02-09 Thread Mark Lawrence
On 09/02/2013 14:27, Morten Engvoldsen wrote: Hi Team, I Have saved my output in .doc file and want to format the output with *Start the File Some data here ***End of File* Can you let me know how can i do that

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

2013-02-09 Thread Terry Reedy
On 2/9/2013 11:21 AM, rusi wrote: On Feb 9, 7:27 pm, Morten Engvoldsen mortene...@gmail.com wrote: Hi Team, I Have saved my output in .doc file and want to format the output with *Start the File Some data here ***End of

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

2013-02-09 Thread Morten Engvoldsen
Hi Dave, This sounds great, thanks for your help :) On Sat, Feb 9, 2013 at 6:13 PM, Dave Angel da...@davea.name wrote: On 02/09/2013 10:01 AM, Morten Engvoldsen wrote: Hi Davea, I am using Python 2.7. Sorry, I should have noticed the python version in the subject line, but didn't until