Embedding a for inside an html template for substitution

Ferrous Cranus nikos.gr33k at gmail.com
Mon Mar 4 10:14:00 EST 2013


Hello pythonistas!

I'am tryign to populate a table with dictionary keys and values:

Foe that iam using an html template and the questions is what i should write inside 'files.html' so then then the python script populate the table.

<table>
	<tr><th>SuperHost - Economy</th></tr>
	<tr><td>Χώρος στο δίσκο: 1 GB</td></tr>
	<tr><td>Μηνιαία Κίνηση δεδομένων: 1 GB</td></tr>
	<tr><td>Control Panel: cPanel 11 & Fantastico Deluxe</td></tr>
	<tr><td>Domains: 1</td></tr>
	<tr><td>Subdomains: 1</td></tr>
	<tr><td>FTP Accounts: 1</td></tr>
	<tr><td>Emails (POP3): 2</td></tr>
	<tr><td>WebMail: [ RoundCube|Horde|Squirrel ]: ΝΑΙ</td></tr>
	<tr><td>Mysql Databases: 2</td></tr>
</table>

Instead of writing the above html data inside my html template how would i write it with a for that then will be substituted by the python script?

can you please write an example for me that user "files.html" and gets populates by "files.py" ?

i want os ee how it lloks like please!

Thank you.



More information about the Python-list mailing list