0

I want to execute python from a java google app engine application. I can use some libs as jython but it would be better to use native python and access the real python api.

Any idea?

4
  • do you need to invoke Python code from your Java application? There is an ability to have 2 versions of application, one in Python and one in Java Commented Apr 15, 2012 at 21:33
  • yes I need to invoke python snippets Commented Apr 15, 2012 at 21:38
  • see (python-gwt-rpc)[code.google.com/p/python-gwt-rpc/] is it what you required? Commented Apr 15, 2012 at 21:47
  • i wouldn't like to make a roundtrip to the presentation layer to execute a snippet of python Commented Apr 16, 2012 at 13:11

1 Answer 1

2

You cannot deploy python and java code inside the same app version. But you can have running different version of the appspot application in java and python.

So you can simply deploy them to different versions. Note versions don't have to be numeric. You can deploy your java code to version "java" and the corresponding url will be http://java.YourApp.appspot.com ; and deploy your python to http://py.YourApp.appspot.com by using version "py"

You can let java and python versions communicate between each other by using JSON (more precisely JSONP [for cross site requests]) http://code.google.com/webtoolkit/tutorials/1.6/Xsite.html or Taskqueue

Sign up to request clarification or add additional context in comments.

4 Comments

I dont want to pass thru the UI to execute Python, i'd like to make server calls.
what about the java scripting engine interface?
You have to go throught the UX but you need to associate a url to call even restricted to admin.. if you want the java app being able to call the python app. Now you can make the call from app to app directly with urllib or via taskqueue if you don't need to wait for the result
I really don't see an easier way because I don't think that Jython will work on App Engine. Alas working on GAE has loads of restriction.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.