[Tutor] Python in Java [was Re: Tutor Digest, Vol 96, Issue 69]

Steven D'Aprano steve at pearwood.info
Fri Feb 17 01:28:18 CET 2012

Nicholas Palmer wrote:
> I am fairly experienced in java and I was wondering how to use java in
> python code, if you could give me any tips.\

My first tip is to learn how to use email effectively. Doing so will increase 
the chances that volunteers on mailing lists will answer your questions with 
respect instead of dismissing you as rude or incompetent or both.

(1) Please do not hijack existing threads for a new question, because your 
question may be missed or ignored by others. Always use your mail program's 
"Write Email" command (or equivalent) to ask a new question, not Reply or 
Reply All.

(2) That includes replying to message digests. Never use Reply unless you are 
actually *replying*.

(3) Always use Reply All to ensure a copy of your reply goes to the list, 
unless you wish to make a private (personal) comment to the person you are 
replying to.

(4) Always choose a sensible, meaningful subject line, such as "How to use 
Python with Java", and not "Re: [Tutor] Tutor Digest, Vol 96, Issue 69" or "Help".

(5) When replying, trim the irrelevant parts of the previous message. There is 
no need to include quotes of quotes of quotes of quotes going back through 
fifteen messages.

To answer your question about running Python in Java, there is an 
implementation of Python written in Java which has very high integration with 
the Java virtual machine and runtime libraries:


You might also try JPype, which promises Java to Python integration:


or Jepp:


or basically google for "python in java" or similar:



More information about the Tutor mailing list