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

Morten Engvoldsen mortenengv at gmail.com
Sat Feb 9 15:52:13 CET 2013


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 times
-- any python code i can add the formatting in dynamic way instead of
hardcoding with "***************Start file***********" line.

Thanks for your reply again.




On Sat, Feb 9, 2013 at 3:38 PM, D'Arcy J.M. Cain <darcy at druid.net> wrote:

> On Sat, 9 Feb 2013 15:27:16 +0100
> Morten Engvoldsen <mortenengv at 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 you let me know how can i do that using Python?
>
> Seems pretty simple.  Open the file, read it into a variable, print the
> header, print the data and then print the footer.  Which part are you
> struggling with? Show us your code so far.
>
> Or is the issue with the .doc file?  Is it a Word document or simple
> text?
>
> --
> D'Arcy J.M. Cain <darcy at druid.net>         |  Democracy is three wolves
> http://www.druid.net/darcy/                |  and a sheep voting on
> +1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.
> IM: darcy at Vex.Net, VOIP: sip:darcy at Vex.Net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130209/3ed0a533/attachment.html>


More information about the Python-list mailing list