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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'append': 0.07; 'subject:file': 0.07; 'python': 0.09; "'''": 0.09; 'fails.': 0.09; 'inserted': 0.09; 'snippet': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'template': 0.11; 'charset:iso-8859-7': 0.15; '.py': 0.16; 'beautifully': 0.16; 'f.read()': 0.16; 'inserting': 0.16; 'opened.': 0.16; 'string': 0.17; 'tries': 0.17; 'changes': 0.20; 'file.': 0.20; 'do.': 0.21; 'skip:= 20': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'script': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'quoting': 0.29; 'subject:end': 0.29; 'subject:some': 0.29; 'file': 0.32; 'print': 0.32; 'subject: .': 0.33; 'subject:data': 0.33; 'received:google.com': 0.34; 'but': 0.36; 'data': 0.37; 'subject:: ': 0.38; 'subject:-': 0.40; 'end': 0.40; 'url:show': 0.84; '\xc1\xf1\xe9\xe8\xec\xfc\xf2': 0.84 X-Received: by 10.49.98.42 with SMTP id ef10mr2638542qeb.15.1362509605732; Tue, 05 Mar 2013 10:53:25 -0800 (PST) Newsgroups: comp.lang.python Date: Tue, 5 Mar 2013 10:53:25 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.68.127.128; posting-account=DYJQ-woAAACEPH85Au2BhUVfFTfSfVa4 References: <7e0a8562-9a48-4f5a-804d-3751733288f0@googlegroups.com> <14d3a13e-9d95-49b5-9d58-205021b79630@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 94.68.127.128 MIME-Version: 1.0 Subject: Re: Inserting-embedding some html data at the end of a .py file From: =?ISO-8859-7?B?zd/q7/Igw+rxMzPq?= To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org 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: , Message-ID: Lines: 47 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362512349 news.xs4all.nl 6942 [2001:888:2000:d::a6]:55589 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40564 Let's focus on just the following snipper please: f =3D open( some_python_file ) =09 htmldata =3D f.read() counter =3D ''' print( "
" ) ''' % data[0]=09 =09 #render template =09 template =3D htmldata + counter print ( template ) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D What this snippet tries to accomplish is append the following string =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D counter =3D '''
=C1=F1=E9=E8=EC=FC=F2 =C5=F0=E9=F3=EA=E5=F0= =F4=FE=ED %d
''' % data[0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D at the end of the the python script file that it currently opened. I'am using the print statemnt inside the triple quoted string so to append = that html data by inserting a print statemnt but although i have changes th= e type of quoting it still fails. If i try to append that html data to an .html file they are inserted beauti= fully but inside a .py file they dont. I just need to append that string after the end of a .py file. that's all i= want to do.
=C1=F1=E9=E8=EC=FC=F2 =C5=F0=E9=F3=EA= =E5=F0=F4=FE=ED %d