myusuf3 myusuf3 - 9 days ago 5
Python Question

django and calling cli java application

I am just trying to gather some information, and whether it is possible to tie in cli java application and set up the class path using python. Also to be able to pass data around and share information between the two applications (web frontend and java application)

I currently I have a java application and looking to see if it is possible interface the two between django and java. Since I am familiar with it, instead of having to learn a new web framework like wicket.

I understand this maybe more python specific than django, any help would be appreciated.

Thanks

Answer

In Python you can run other programs using module subprocess and read/write from their standard output/input. More complex CLI (command-line) applications can be controlled with pexpect. Of course you can set environment variable CLASSPATH.

If you want to run other programs in a web app (Django), make sure it will not make your users waiting for the HTML page for too long.