473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Simple HTML template engine?

Hello,

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?

No need for caching, template compilation, etc.

Speed is not a major issue.

I just need looping and conditionals. Template inheritance would be a
bonus.

I've seen Genshi and Cheetah, but they seem way too complex.

Any ideas?

I'm sure I could build something myself, but I'm sure this has already
been done quite a few times. Why re-invent the wheel, right?
Thank you,
Allen

Oct 15 '07 #1
17 3192
allen.fowler wrote:
Hello,

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?

No need for caching, template compilation, etc.

Speed is not a major issue.

I just need looping and conditionals. Template inheritance would be a
bonus.
HTMLTemplate is a minimal system for that sort of thing.
It doesn't drag in some big "framework".

John Nagle
Oct 15 '07 #2
"allen.fowler" <al**********@yahoo.comwrote in
news:11**********************@e9g2000prf.googlegro ups.com:
Hello,

Can anyone recommend a simple python template engine for
generating HTML that relies only on the Pyhon Core modules?

No need for caching, template compilation, etc.

Speed is not a major issue.

I just need looping and conditionals. Template inheritance
would be a bonus.

I've seen Genshi and Cheetah, but they seem way too complex.

Any ideas?
Did you try Cheetah? I've just started using it for a simple job,
just looping and conditionals and it seemed quite simple to me.

Adrian

Oct 15 '07 #3
Have you tried CherryPy? http://www.cherrypy.org/

It's not a template engine, but a simple web server engine, and
you could code your conditionals and loops directly in Python... When
I have tried it, it looked very nice and easy.

Ciprian.
On 10/15/07, allen.fowler <al**********@yahoo.comwrote:
Hello,

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?

No need for caching, template compilation, etc.

Speed is not a major issue.

I just need looping and conditionals. Template inheritance would be a
bonus.

I've seen Genshi and Cheetah, but they seem way too complex.

Any ideas?

I'm sure I could build something myself, but I'm sure this has already
been done quite a few times. Why re-invent the wheel, right?
Thank you,
Allen
Oct 15 '07 #4
allen.fowler wrote:
Hello,

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?
Mako (http://www.makotemplates.org/) sounds like what you want..

Will McGugan
http://www.willmcgugan.com
Oct 15 '07 #5
allen.fowler wrote:
Hello,

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?
Mako (http://www.makotemplates.org/) sounds like what you want..

Will McGugan
http://www.willmcgugan.com
Oct 15 '07 #6
Ivo
Ciprian Dorin Craciun wrote:
Have you tried CherryPy? http://www.cherrypy.org/

It's not a template engine, but a simple web server engine, and
you could code your conditionals and loops directly in Python... When
I have tried it, it looked very nice and easy.

Ciprian.
On 10/15/07, allen.fowler <al**********@yahoo.comwrote:
>Hello,

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?

No need for caching, template compilation, etc.

Speed is not a major issue.

I just need looping and conditionals. Template inheritance would be a
bonus.

I've seen Genshi and Cheetah, but they seem way too complex.

Any ideas?

I'm sure I could build something myself, but I'm sure this has already
been done quite a few times. Why re-invent the wheel, right?
Thank you,
Allen
I concur completely!
My site http://IvoNet.nl is completely written in python and based on a
very early release of cherrypy.

gr,
Ivo.
Oct 15 '07 #7
CherryPy looks nice... though I am just looking to generate static
reports.

Thanks anyway... I'll keep it in mind for the future.

On Oct 15, 4:38 am, "Ciprian Dorin Craciun"
<ciprian.crac...@gmail.comwrote:
Have you tried CherryPy?http://www.cherrypy.org/

It's not a template engine, but a simple web server engine, and
you could code your conditionals and loops directly in Python... When
I have tried it, it looked very nice and easy.

Ciprian.
Oct 16 '07 #8
In article <11**********************@e9g2000prf.googlegroups. com>,
"allen.fowler" <al**********@yahoo.comwrote:
Hello,

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?

No need for caching, template compilation, etc.

Speed is not a major issue.

I just need looping and conditionals. Template inheritance would be a
bonus.

I've seen Genshi and Cheetah, but they seem way too complex.
I use Spyce, but in addition to being a template system for mixing
Python & HTML, it is also a Web server which drags in a bunch of extra
cruft that you don't need. It's what I use to generate static reports,
though.

Good luck

--
Philip
http://NikitaTheSpider.com/
Whole-site HTML validation, link checking and more
Oct 16 '07 #9
On Oct 15, 1:26 am, John Nagle <na...@animats.comwrote:
allen.fowler wrote:
Hello,
Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?
No need for caching, template compilation, etc.
Speed is not a major issue.
I just need looping and conditionals. Template inheritance would be a
bonus.

HTMLTemplate is a minimal system for that sort of thing.
It doesn't drag in some big "framework".

John Nagle

This look exactly like what I need.

Google first led me to the "HTML::Template" perl library.

But now i've got the right one at: http://freespace.virgin.net/hamish.s...ltemplate.html

Thank you.

Oct 16 '07 #10
On Oct 15, 1:26 am, John Nagle <na...@animats.comwrote:
allen.fowler wrote:
Hello,
Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?
No need for caching, template compilation, etc.
Speed is not a major issue.
I just need looping and conditionals. Template inheritance would be a
bonus.

HTMLTemplate is a minimal system for that sort of thing.
It doesn't drag in some big "framework".

John Nagle
Thanks...
Wait a sec... this is a Perl module...

Am I missing something? :)
Allen

Oct 16 '07 #11
CherryPy looks nice... though I am just looking to generate static
reports.

Thanks anyway... I'll keep it in mind for the future.

On Oct 15, 4:38 am, "Ciprian Dorin Craciun"
<ciprian.crac...@gmail.comwrote:
Have you tried CherryPy?http://www.cherrypy.org/

It's not a template engine, but a simple web server engine, and
you could code your conditionals and loops directly in Python... When
I have tried it, it looked very nice and easy.

Ciprian.
Oct 16 '07 #12
allen.fowler wrote:
>Hello,

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?

No need for caching, template compilation, etc.

Speed is not a major issue.

I just need looping and conditionals. Template inheritance would be a
bonus.

I've seen Genshi and Cheetah, but they seem way too complex.

Any ideas?

I'm sure I could build something myself, but I'm sure this has already
been done quite a few times. Why re-invent the wheel, right?
Thank you,
Allen
http://htmltmpl.sourceforge.net/

It has loops and conditionals, simple to use. Very simple.
Kind of old program (dont seems to have suffer modifications since 2001)

Try it.
Cheers.

Gerardo
Oct 16 '07 #13
On Oct 16, 4:07 am, jean-michel bain-cornu <nos...@nospam.frwrote:
Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?
No need for caching, template compilation, etc.
Speed is not a major issue.
I just need looping and conditionals. Template inheritance would be a
bonus.

I have written my own a couple of years ago.
Haven't we all.

When I wrote mine (HRL), the 5 million web page systems out there
seemed all to be either:

A. Intricate frameworks like Zope with a maniacal insistence on
separation of content from presentation (not that that's bad, it's
just a lot of unnecessary overhead for my needs).

or

B. Template systems with very little versatility.

These days there seems to be more coverage of different needs. For
instance, Mako looks like something I might have used if it had been
around back then.
Carl Banks

Oct 16 '07 #14
Adrian Cherry a écrit :
"allen.fowler" <al**********@yahoo.comwrote in
news:11**********************@e9g2000prf.googlegro ups.com:

>>Hello,

Can anyone recommend a simple python template engine for
generating HTML that relies only on the Pyhon Core modules?

No need for caching, template compilation, etc.

Speed is not a major issue.

I just need looping and conditionals. Template inheritance
would be a bonus.

I've seen Genshi and Cheetah, but they seem way too complex.

Any ideas?


Did you try Cheetah?
Did you read the OP's question ?-)
Oct 16 '07 #15
These days there seems to be more coverage of different needs. For
instance, Mako looks like something I might have used if it had been
around back then.
It's probably the same to me.
And many times, the simple python templating system %(var)s is good
enough...
Oct 16 '07 #16
This one is really small and simple (one small file):

http://davidbau.com/archives/2007/02...templates.html

"allen.fowler" <al**********@yahoo.comwrote in message
news:11**********************@e9g2000prf.googlegro ups.com...
Hello,

Can anyone recommend a simple python template engine for generating
HTML that relies only on the Pyhon Core modules?

No need for caching, template compilation, etc.

Speed is not a major issue.

I just need looping and conditionals. Template inheritance would be a
bonus.

I've seen Genshi and Cheetah, but they seem way too complex.

Any ideas?

I'm sure I could build something myself, but I'm sure this has already
been done quite a few times. Why re-invent the wheel, right?
Thank you,
Allen

Oct 17 '07 #17
Bruno Desthuilliers <bd*****************@free.quelquepart.fr>
wrote in news:47***********************@news.free.fr:
>
Did you read the OP's question ?-)
Yup, as much as anyone else has. Why?

Adrian

Oct 17 '07 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Nick Messick | last post by:
I have a multi step signup form that I'm building and I have the following question. Should I do it this way: <?php if (blah == 1) { ?><table><td width="100">........etc <?php } else { ?>...
1
by: Wensheng | last post by:
Hi, I wrote a small template engine called spytee. Like any template enigne, it take a text(html) template file as input, process the variable tags in the file, and display the resulted text. The...
1
by: C. Olive | last post by:
Environment: Classic ASP running on IIS v5.1 Scripting Language: VBScript I suppose someone would have to be somewhat familiar with Perl in order to answer this question specifically. If you...
1
by: gene.ellis | last post by:
Hey everyone, There is probably a really simple solution. I have an XSL document that reads into content from my XML document and creates an HTML document (with a .php extension). There is some...
8
by: HchC | last post by:
PHP is already a HTML templating laguage, but I am looking for a HTML template engine for users who know nothing about HTML. This template engine should not be too complex, as this is for very...
1
by: Robert J. Hansen | last post by:
I'm exploring the use of type traits (which, I hasten to say, I've hardly ever used before) as a way to help simplify some complex special-case logic in an existing codebase. I'm finding that I'm...
73
by: Claudio Grondi | last post by:
In the process of learning about some deeper details of Python I am curious if it is possible to write a 'prefix' code assigning to a and b something special, so, that Python gets trapped in an...
1
by: gcmartijn | last post by:
H! I was wondering how I can do something like this. file.html --------- <b>hello world</b> <special pythoncodetag> print 'hello world' #or display str(time.localtime())
5
by: prakash.mirji | last post by:
I am using evaluation copy of RW 9.0 for porting one of C++ application on RHEL4 (x86 platform). We are getting some issues into RW template classes. Please need assistance on this issue. Here...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.