Inserting-embedding some html data at the end of a .py file
Joel Goldstick
joel.goldstick at gmail.com
Tue Mar 5 12:45:25 EST 2013
On Tue, Mar 5, 2013 at 12:39 PM, Νίκος Γκρ33κ <nikos.gr33k at gmail.com> wrote:
> But i did, I just tried this:
>
> # open html template
> if htmlpage.endswith('.html'):
> f = open( "/home/nikos/public_html/" + htmlpage )
>
> htmldata = f.read()
> counter = ''' <center><a href="mailto:
> support at superhost.gr"> <img src="/data/images/mail.png"> </a>
> <center><table border=2
> cellpadding=2 bgcolor=black>
> <td><font
> color=lime>Αριθμός Επισκεπτών</td>
> <td><a href="
> http://superhost.gr/?show=stats"><font color=cyan> %d </td>
> ''' % data[0]
> else:
> f = open( "/home/nikos/public_html/cgi-bin/" + htmlpage )
>
> htmldata = f.read()
> counter = '''
> print '''<center><a href="mailto:
> support at superhost.gr"> <img src="/data/images/mail.png"> </a>
> <center><table border=2
> cellpadding=2 bgcolor=black>
> <td><font
> color=lime>Αριθμός Επισκεπτών</td>
> <td><a href="
> http://superhost.gr/?show=stats"><font color=cyan> %d </td>
> '''
>
remove the extra triple quote. But seriously, in 2013 you are writing html
like the above? That is some awful stuff
> ''' % data[0]
>
> template = htmldata + counter
> print ( template )
> =============
>
> But still doens't embed correctly the additional html data at the end of
> the .py files.....
>
> Do you have an idea?
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Joel Goldstick
http://joelgoldstick.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130305/28a0eb7a/attachment.html>
More information about the Python-list
mailing list