Message Boards Message Boards

1
|
24951 Views
|
8 Replies
|
9 Total Likes
View groups...
Share
Share this post:

Is there a way to run Python from within Mathematica 10.0.2?

Posted 10 years ago

Hi,

I would like to use Mathematica 10.0.2. via mathlink by Python like in former versions of Mathematica 9.0.0 and Mathematica 10.0.0. But the Python Link "C:\Program Files\Wolfram Research\Mathematica\10.0\SystemFiles\Links\python" is missed. Is there a way to run Python from within Mathematica 10.0.2?

POSTED BY: Alachew Mengist
8 Replies

For simple purposes, you could always run a python script using "Run".

http://reference.wolfram.com/language/tutorial/ExternalPrograms.html

Are you familiar with how to use the command line?

Some people have created links between Python and Mathematica in the past. These don't seem to be maintained though. Here's the example of one: http://library.wolfram.com/infocenter/MathSource/6622/

POSTED BY: Sean Clarke

I think it's a pity that Wolfram doesn't offer a supported solution for integrating Python and Wolfram code. Certainly with Wolfram's ambition in joining the Data Scientist arena with a Data Science Platform I believe they should offer an integration. As far as I know I believe that Python is nr1 language for Data Scientists.

POSTED BY: l van Veen
Posted 10 years ago

Thank you for your reply.

Do you have any idea why a binding of the Python language to Wolfram Research Inc.'s(WRI) MathLink library is removed in Mathematica 10.0.2? In the former versions it is incluided and can be fonund in "C:\Program Files\Wolfram Research\Mathematica\9.0\SystemFiles\Links\python". I would like to use some WSM API's from Python.

POSTED BY: Alachew Mengist

It looks like the pythonika project is more updated than I had originally thought, but I'm still not sure if it works in 10:

https://code.google.com/p/pythonika/

No, I don't know why it is no longer included. The file was never supported and probably not meant to be a long term solution.

POSTED BY: Sean Clarke
Posted 10 years ago
Posted 10 years ago

Hi Sean,

What type of license does the Python content inside of the Links directory had in Mathimathica 9.0.1? Is it possible to redistribute it and/or modify and support them as third party in our free software ?

POSTED BY: Alachew Mengist

I have managed to use Pythonika in 10.0.2. Simply download one of the compiled versions from https://code.google.com/p/pythonika/downloads/list You will need to install an ancient version of Python, 2.7 at most.

The source provided does allow compiling for different versions of Python. I have tried at length to compile this for Python 3.4, but I haven't yet succeeded. If anyone has better luck please let me know!

POSTED BY: David Gathercole
Posted 10 years ago

I've also been trying call Python from MMA 10.0.2. I've been trying to use the StartProcess[] command to start a python interpreter and then use WriteBinary and ReadString to the process' stdin, stdout and stderr. However not really with any success. The trivial examples in the documentation with 'cmd' do work but I haven't been able to build on them.

Your success with Pythonika is encouraging, I'll give that a go.

POSTED BY: Peter Crosbie
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract