|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
need Some help
Hi everybody,
I am a novice user of python and to say i am not that aware of python .here i got a problem to convert some python code to Java ,i'll be grateful if any body gives some help in converting my code(which is given below to Java) Regards, Sena. The python code is zipped |
|
#2
|
||||
|
||||
|
have you looked at Jython? This is a version of python written entirly in Java and runs under the JVM. In any case this could save you some work converting Python files into Java since you can compile Python programs though Jython to Java Bytecode! Letting them run on any JVM!
http://www.jython.org/ Hope this helps, Mark. |
|
#3
|
|||
|
|||
|
Why do you need the code in Java? What is wrong with using it in Python? It is not a library, so you will not be able to call it from Java. If you convert it to Java you will end up with code that is longer, less readable and maintainable, and will quite possibly not run any faster (it may even be slower). To be honest the code does not look very well written as it is and could do with serious refactoring, so porting it unchanged to Java will just make it worse.
I also notice that it imports a number of external modules that are not part of the standard library. If you convert the program to Java, you will need to convert all of those as well. In short, either stick with Python, or use Jython if you need to extend it using the Java libraries. Dave - The Developers' Coach |
|
#4
|
||||
|
||||
|
Daves right. And, the one reason i can think of that you might want to convert Python into Java is to run it on a system where the Python interpreter isnt available. In which case all you need is the Jython
.Good luck, Mark. |
|
#5
|
||||
|
||||
|
If you have to install jython you might as well install python and save the aggro I think.
![]()
__________________
*** Experimental Python Markup CGI V2 *** |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > need Some help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|