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


Groups > comp.lang.python > #38579

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!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <dwightdhutto@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'none,': 0.05; 'f.close()': 0.07; 'function,': 0.07; 'none)': 0.07; 'none):': 0.07; 'subject:file': 0.07; 'open(file,': 0.09; 'subject:2.7': 0.09; 'cc:addr:python-list': 0.10; 'looked': 0.10; 'def': 0.10; 'subject: \n ': 0.16; "haven't": 0.23; 'cc:no real name:2**0': 0.24; 'cc:2**1': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'probably': 0.29; 'text,': 0.33; 'received:google.com': 0.34; 'text': 0.34; 'received:209.85': 0.35; 'something': 0.35; 'but': 0.36; 'subject:with': 0.36; 'received:209': 0.37; 'received:209.85.216': 0.37; 'subject:: ': 0.38; 'subject:Any': 0.84; 'wrapper,': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=U/GIhsFHcQGVptv7NE4pSsGy4F2dWxgNBrea8L8KvyE=; b=c/Hci7uBw/Fe4Y03bRVMkRsSapW+tfLCSFxa5NNLQSCgxXM/kPYukMmjRw7b8TbYRK eZQAHZwOFu5SiIFu08oE8+I8F+5WS6GlU0JOO1jitQQmfu4A0ybNPVWJ4ytsodf5fg7j S7TZAWbSSPE5RcWJWtSKz/L8Lt2EhX11coGAvQmzDd/RUBf7w+wi7/k9le7MOYy52mY1 gwGSoCerCF8DhmiUaaX40QKpoA7SS/DloSZVgzWcyi+TsSDsBoNQsVs5lkE7p6JjWOhd CvR8sf/0VQ2Cvqxbmmfr1dYgtX2o9+JCoFUUX7gYauoUMnu6pRWmjKLokCN3QvILdvEd TJag==
MIME-Version 1.0
X-Received by 10.224.138.148 with SMTP id a20mr4639129qau.38.1360513814105; Sun, 10 Feb 2013 08:30:14 -0800 (PST)
In-Reply-To <CA+vVgJUc5obkPvjMmSXm_HVHZV+Y+XgN7fofT8pyaq=Yzm_+mA@mail.gmail.com>
References <CAJ2vgs7cPKtb3fv=heMtfV7nS-15G+4npRVCkJLqx-CAkrMgVQ@mail.gmail.com> <1670212.1goHRf2svO@mach-114-20> <CAJ2vgs4s3UrrUG7B9mJhZ00ZZuFUaADKqYDKCPR8pNvai-mcCQ@mail.gmail.com> <CA+vVgJUc5obkPvjMmSXm_HVHZV+Y+XgN7fofT8pyaq=Yzm_+mA@mail.gmail.com>
Date Sun, 10 Feb 2013 11:30:13 -0500
Subject Re: Any idea how i can format my output file with ********************Start file*********************** usinf Python 2.7
From David Hutto <dwightdhutto@gmail.com>
To Morten Engvoldsen <mortenengv@gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Cc python-list@python.org, inq1ltd <inq1ltd@inqvista.com>
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.1585.1360513822.2939.python-list@python.org> (permalink)
Lines 14
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1360513822 news.xs4all.nl 6851 [2001:888:2000:d::a6]:35767
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:38579

Show key headers only | View raw


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()


-- 
Best Regards,
David Hutto
CEO: http://www.hitwebdevelopment.com

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 David Hutto <dwightdhutto@gmail.com> - 2013-02-10 11:30 -0500

csiph-web