Jump to content

How to use python's capabilities w/ other languages?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
hellochar

hellochar

    Newbie

  • Members
  • PipPip
  • 10 posts
Hi, I'm not sure exactly where to put this, but I figure this forum makes sense. I want to use python's math capabilities in Java, does anyone know how I would do that? Is there some way to connect the two languages together so I can use both? For instance, I need Python's math calculations in one of my Java programs - how can I access Python and its capabilities through Java? Is there a way at all?

#2
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
I haven't yet seen any project mixing Python and Java, and I don't think it's possible using the official implementation of Python - but I wouldn't be surprised if someone had done some tweaking to get it working. Python has an official API for C, so if you could live with C (and eventually, C++) it would be fairly easy for you to get started.

Another alternative is Jython, though it isn't exactly what you're looking for. Jython is an unofficial implementation of the Python language written in Java. It means that Python will run on every platform supporting Java, and having Jython. As Jython is written in Java, I'm pretty sure that you will be able to mix the two languages, though I've never been working with Jython myself.

Good luck!