Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38523

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

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <davea@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'explicitly': 0.04; 'output': 0.04; 'subject:Python': 0.05; 'subject:file': 0.07; 'python': 0.09; 'extension,': 0.09; 'subject:2.7': 0.09; 'file,': 0.15; 'skip:f 30': 0.15; 'different,': 0.16; 'guess.': 0.16; 'subject: \n ': 0.16; 'wrote:': 0.17; 'team,': 0.18; 'python?': 0.20; 'file.': 0.20; 'trying': 0.21; '3.x': 0.22; 'assuming': 0.22; 'example': 0.23; 'proprietary': 0.23; 'statement': 0.23; 'least': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'looks': 0.26; 'creating': 0.26; 'am,': 0.27; 'environment.': 0.27; 'function': 0.30; 'file': 0.32; 'print': 0.32; 'to:addr:python-list': 0.33; 'another': 0.33; 'text': 0.34; 'saved': 0.35; 'skip:* 20': 0.35; 'add': 0.36; 'wanted': 0.36; 'closing': 0.36; 'subject:with': 0.36; 'quite': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'your': 0.60; 'telling': 0.61; 'information': 0.63; 'more': 0.63; 'here': 0.65; 'received:74.208': 0.71; 'directed': 0.81; 'subject:Any': 0.84
Date Sat, 09 Feb 2013 09:38:01 -0500
From Dave Angel <davea@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2
MIME-Version 1.0
To python-list@python.org
Subject Re: Any idea how i can format my output file with ********************Start file*********************** usinf Python 2.7
References <CAJ2vgs7cPKtb3fv=heMtfV7nS-15G+4npRVCkJLqx-CAkrMgVQ@mail.gmail.com>
In-Reply-To <CAJ2vgs7cPKtb3fv=heMtfV7nS-15G+4npRVCkJLqx-CAkrMgVQ@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:z+DbX3Vb5fF0aXALTlT8Kfko4lNxRbSa5LtM+2zFJMT SD4ykZ1ptkCIuDw5g+papQ4EF4LufID1oTT2hk7UU/gJtn1HIU dAFJJJwAneTY8XP73C3tcTPfXhlE/yaGNq50veVwNK//2qizZg 6LWkxeQC1LJAhR5g7Zp/S2nP6bUvJ6LKujE9kgtLyNmuJYHdNc RM+M+duYTinjVHBge+jSAYGMrW2jK6fkICCdyfRfDK57nwdFx5 cflPD9N1bj6xagjZupAvbgMByMQS/GhJaKbV9M/kSI89A+VyM5 EO2QQFqGj+zEUqrmyQKP9q6/VMKDEVJj+rN2KsEaGusjpdqmw= =
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1551.1360420708.2939.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1360420708 news.xs4all.nl 6981 [2001:888:2000:d::a6]:43900
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:38523

Show key headers only | View raw


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 that using Python?
>
>
>

Just add an output statement right after creating the file, and another 
just before closing it.

This is assuming that this is a text file.  By explicitly telling us it 
has a .doc extension, you may be trying to tell us it's in some 
proprietary file format whose type we have to guess.

BTW, if you actually wanted *code*, you might have considered including 
some more information about your environment.  For example a print 
statement is an output statement in Python 2.x, while the print function 
in Python 3.x looks quite different, at least when directed to a file.

-- 
DaveA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Any idea how i can format my output file with ********************Start file*********************** usinf Python 2.7 Dave Angel <davea@davea.name> - 2013-02-09 09:38 -0500

csiph-web