Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.032 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'append': 0.07; 'subject:file': 0.07; "'''": 0.09; 'template': 0.11; 'charset:iso-8859-7': 0.15; 'file,': 0.15; '.py': 0.16; 'f.read()': 0.16; 'wrote:': 0.17; 'trying': 0.21; 'insert': 0.23; 'thus': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'skip:" 20': 0.26; 'run': 0.28; 'appending': 0.29; 'subject:end': 0.29; 'subject:some': 0.29; 'waste': 0.30; 'code': 0.31; 'file': 0.32; 'print': 0.32; 'subject: .': 0.33; 'subject:data': 0.33; 'to:addr:python-list': 0.33; 'thanks': 0.34; 'pm,': 0.35; 'but': 0.36; 'data.': 0.36; 'does': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'talk': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'subject:-': 0.40; 'end': 0.40; 'telling': 0.61; 'dont': 0.64; 'our': 0.65; 'received:74.208': 0.71; 'url:show': 0.84; '\xc1\xf1\xe9\xe8\xec\xfc\xf2': 0.84 Date: Tue, 05 Mar 2013 16:02:18 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Inserting-embedding some html data at the end of a .py file References: <7e0a8562-9a48-4f5a-804d-3751733288f0@googlegroups.com> <9af13b75-a7b0-45c9-a801-797989583cd5@googlegroups.com> In-Reply-To: <9af13b75-a7b0-45c9-a801-797989583cd5@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:YQ3Lvcgzt8peBskeD9Tq2E+xo9xQiRGB7tHFm9HMQx4 ImGf7Dt7al4VZz13UKUJraj5jcI2kdyvtCH8Mdhux2FfjTU8qS s4c7ces8LGCEK4gWadut9Owc4VUs1lbbpRHosbG+LRTfXPzLN6 VhzAuiIf8HsX80L1cFVt3AwdpkoK74rNndd0Pw4uEjz9W4z03D paDalhikdfkLZ7Lj6KzTBSqSc/3gtr4JaRMjQCVtcIab2NX6l5 tus+R81whc8ndMMDWIauB2QBR+DlZigBjJ+6ev3Hq81OXI8B5L DE5H5VxdN0yQ02RRm/crOd+0ilvKxdMQq1wQztEc6tiXLj8vw= = X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362517358 news.xs4all.nl 6845 [2001:888:2000:d::a6]:60842 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40570 On 03/05/2013 03:04 PM, Νίκος Γκρ33κ wrote: > #open html template > if htmlpage.endswith('.html'): > f = open( "/home/nikos/public_html/" + htmlpage ) > > htmldata = f.read() > counter = '''
>
> > > ''' % data[0] > > #render template > template = htmldata + counter > print ( template ) > ============================================ > Yes the aboev code does work if we talk about appending html data to an already html file! > > But if the file is some_python.py file then i cannot just append the data. > Actually by appending i dont want to actually insert the data to the end of the .py file, thus altering it but instead run the .py file and print the counter html data afterwards! > In other words, you're just trying to waste our time. Thanks for telling us. -- DaveA
Αριθμός Επισκεπτών %d