Re: How do i call a function written in mathematica from python
- To: mathgroup at smc.vnet.net
- Subject: [mg39757] Re: [mg39750] How do i call a function written in mathematica from python
- From: Sseziwa Mukasa <mukasa at jeol.com>
- Date: Thu, 6 Mar 2003 02:35:19 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
On Wednesday, March 5, 2003, at 12:05 AM, Anand wrote: > Hi, > someone has written a complex curvefitting in mathematica. I > would like to call the mathematica function from python. To my > understanding, the mathematica expects probably a path to where a > bunch of text files are and will ouput the result as a file in the > same directory.I have no experience with mathematica. Thanks for your > help in advance. > Without any experience with Mathematica it would not be easy to do this. It depends on how the function was written as a notebook or as a package, although you can turn the former into the latter and for your purposes probably want to. Also there are two methods to access the kernel from external programs, Mathlink: a C interface which is probably easier from Python and J/Link a Java interface. Finally again depending on the implementation the output may or may not be in a file. I suggest 1) getting a copy of Mathematica and using the curve fit function from the notebook interface to get a feel for the Mathematica way of doing things. This is also helpful in getting to step 2) writing some Mathlink or J/Link programs to interface with the curve fitting package (hopefully you have experience in calling external programs from Python). Regards, Ssezi