473,378 Members | 1,434 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,378 software developers and data experts.

creating "jsp-like" tool with python

jd
I'd like to create a program that takes files with "jsp-like" markup
and processes the embedded code (which would be python) to produce the
output file. There would be two kinds of sections in the markup file:
python code to be evaluated, and python code that returns a value that
would be inserted into the output.

This seems like it would be straightforward in python, and maybe
there's even a library that I could use for this, but as a newbie to
Python, I don't know the landscape very well. I am not looking for a
big framework, just something small and simple that will do just this
job. Suggestions or pointers would be greatly appreciated.

Thanks...

-- jeff

Mar 24 '07 #1
3 1475
On Mar 24, 6:18 am, "jd" <chima...@gmail.comwrote:
I'd like to create a program that takes files with "jsp-like" markup
and processes the embedded code (which would be python) to produce the
output file. There would be two kinds of sections in the markup file:
python code to be evaluated, and python code that returns a value that
would be inserted into the output.

This seems like it would be straightforward in python, and maybe
there's even a library that I could use for this, but as a newbie to
Python, I don't know the landscape very well. I am not looking for a
big framework, just something small and simple that will do just this
job. Suggestions or pointers would be greatly appreciated.
Apache's mod_python already does something like this, with its PSP
handler. See http://webpython.codepoint.net/mod_python

Maybe that would help.

--
Kushal Kumaran

Mar 24 '07 #2

jd wrote:
I'd like to create a program that takes files with "jsp-like" markup
and processes the embedded code (which would be python) to produce the
output file. There would be two kinds of sections in the markup file:
python code to be evaluated, and python code that returns a value that
would be inserted into the output.

This seems like it would be straightforward in python, and maybe
there's even a library that I could use for this, but as a newbie to
Python, I don't know the landscape very well. I am not looking for a
big framework, just something small and simple that will do just this
job. Suggestions or pointers would be greatly appreciated.

Thanks...

-- jeff
Sadly, there's probably as many template languages as there are web
frameworks for Python.
Maybe even more. For example:

http://www.djangoproject.com/documentation/templates/
http://nick.borko.org/pse/index.html
http://www.turbogears.org/about/kid.html

Pick your poison.

Mar 24 '07 #3
jd a écrit :
I'd like to create a program that takes files with "jsp-like" markup
and processes the embedded code (which would be python) to produce the
output file. There would be two kinds of sections in the markup file:
python code to be evaluated, and python code that returns a value that
would be inserted into the output.

This seems like it would be straightforward in python, and maybe
there's even a library that I could use for this, but as a newbie to
Python, I don't know the landscape very well. I am not looking for a
big framework, just something small and simple that will do just this
job. Suggestions or pointers would be greatly appreciated.
There are already quite a few Python templating solutions. You may want
to look for:
- Python server pages
- Mighty
- Mako
- Jinja
- Genshi
- Cheetah
- Newov
- Zope Page Templates
- SimpleTAL (standalone implementation of ZPT)
- (add your favorite Python templating system here)
Mar 26 '07 #4

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

Similar topics

11
by: Ux | last post by:
Hi I'm a newbie at JS and I'd like to know, from the expert JS-er, which are the "things" they consider a *must have* (or known/visited/read...) for a professional JS developer. This will help me...
24
by: jrefactors | last post by:
I have an upload file operation in the web application. UploadForm.jsp is the form, and UploadAction.jsp is the form processing. The web server is Websphere. //UploadForm.jsp <FORM...
134
by: James A. Donald | last post by:
I am contemplating getting into Python, which is used by engineers I admire - google and Bram Cohen, but was horrified to read "no variable or argument declarations are necessary." Surely that...
8
by: John Nagle | last post by:
Here's a wierd problem: I have a little test case for M2Crypto, which just opens up SSL connections to web servers and reads their certificates. This works fine. But if I execute ...
1
by: chandrapsg | last post by:
Hi, i am working with jsp .. i wanna help regarding how to import or how to call python modules to jsp if a piece of code is availabe will be very helpful for me chandra
3
by: rkhurana | last post by:
Hi I am writing a JSF application that uses some third party charts. While I can see the chart but the javascript that is supposed to calla function to update chart periodically has a problem. It...
2
by: gusa992000 | last post by:
Hello I am trying the following problem: A web app in jsp and java has to open a microsoft word document directly in the browser. This part is easy and i have done it. The user then can...
4
by: Andy Dingley | last post by:
Another thread <http://groups.google.co.uk/group/alt.www.webmaster/msg/ e7d125cdff1ae2a2> linked to an accessibility checker at this site <http://wave.webaim.org/index.jsp> In their own...
10
by: Prisoner at War | last post by:
Hi, your friendly neighborhood n00b here, just wondering why on earth the Py3K folks want to mess with a simple thing like the "print" "command" (is that what it's called, a command?), turning it...
5
by: GaryDean | last post by:
Anyone know of html screen scrapper software that will work with .net projects. We need to get data back from a gov site that only provides it on a webpage. Thanks, Gary
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?

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.