Inserting-embedding some html data at the end of a .py file

Dave Angel d at davea.name
Tue Mar 5 16:02:18 EST 2013


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 = ''' <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]
>
> 	#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



More information about the Python-list mailing list