Hi Python Experts

I need to convert a code written on JAVA/JSP (Java Tags are also there inside JSP) to PYTHON.

I have OK kind of knowledge in PYTHON, but dont have a muck knowledge in JAVA/JSP.

Any idea how to approach? I am having tough time to achieve this :sad:

Thanks in advance to all
C Saha

Recommended Answers

All 2 Replies

A line by line translation from Java to Python is almost impossible. Java is simply too cumbersome. It is usually best to look at what the Java app does and then start new with Python.

Here is a small side by side comparison of Java and Python:
http://www.ferg.org/projects/python_java_side-by-side.html

You are using Apache to serve content, right? If that's the case, the Mod_python module (an Apache module, not a Python module) provides PSP (Python Server Pages) functionality - just what you'd need to replace your JSPs. You can get more information on this platform by following these links:

Basic PSP tutorial

Official PSP documentation

The Mod_python site

As for a line-by-line Java-to-Python converter? I think you might be out of luck on that one. Your best bet is to learn PSP and the basics of inline programming (if you don't know them already) and then get help for the JSP stuff. I used to do a fair amount of JSP programming, so if you have specific questions you can try me or you can ask the people in the Java or JSP forums, who are bound to be much more knowledgeable.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.