• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to wrap python around java using jython

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been assigned a task to convert a java standalone application to python web application.Recoding the entire module in python language would take a lot of time and effort.Hence I was adviced to do a quick wrap up of python and get the code working (Jython is Python wrap for JAVA )..Could any one guide me how to get started as I am new to Python as well as Jython?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm. I'm not sure Jython helps you at all here. Jython is a Python interpreter written in Java; it lets you run Python code inside a Java application. What you want to do is quite the opposite, if I understand you correctly: you want a Python application -- the web container -- to run some Java code. If the Java code just accepts command-line arguments and spits out some output in a file or on standard output, this would be fairly simple -- you could use use call from the Python subprocess module -- but if the Java program has a GUI, it's going to need to be substantially modified for you to be able to make this work.
 
Sony Chau
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the reply.You've understood my requirement correctly.My application has made use of java swing GUI.You have mentioned it would require substantial modifications to make the application work.Could you throw some light as to what kind of modifications are required and how do I proceed.Currently java swing GUI makes use of lot of JTables and JTabbedPanes.
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, sadly, the whole GUI will have to be removed; you'll have to write a new GUI which works via HTML and Javascript. You may write it in Python or in Java, but I imagine Python would be easier here, using whatever GUI framework the Python web container is set up to use. The rest of the application -- the non-GUI parts -- may have to be modified to deal with multiple simultaneous users. For example, if part of the application writes to a file with a hard-coded name and path, then that code will need to change.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic