Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #65597
| From | Sturla Molden <sturla.molden@gmail.com> |
|---|---|
| Subject | Re: python and matlab |
| Date | 2014-02-07 05:28 +0000 |
| References | <239c6022-9c8d-48d4-8ddf-cae552ab1e3d@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.6484.1391750931.18130.python-list@python.org> (permalink) |
Sam Adams <cuongpn@gmail.com> wrote:
> Thanks Sturla, could you please explain in more details, I am new to Python :)
All the information you need to extend or embed Python is in the docs.
Apart from that, why do you need Matlab? A distro like Enthought Canopy or
Anaconda has all the tools you will ever need for scientific programming.
Embedding Python is almost never the right solution to a problem. But if
you really need Matlab, you will be far better off by calling Matlab engine
from Python (e.g. using ctypes or Cython).
There are also packages like mlab and matlabwrap that will help you embed
Matlab in Python:
https://pypi.python.org/pypi/mlab
http://mlabwrap.sourceforge.net
Apart from that, you can also invoke Python from Matlab like this:
arg1 = 'script.py';
s = system(sprintf('python %s', arg1));
or
arg1 = 'some Python code';
s = system(sprintf('python -c "%s"', arg1));
Or if you are on Windows, you can use pywin32 to create an ActiveX server
with Python, and invoke that from Matlab.
Sturla
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
python and matlab Sam <cuongpn@gmail.com> - 2014-02-06 05:30 -0800
Re: python and matlab Sturla Molden <sturla.molden@gmail.com> - 2014-02-06 13:55 +0000
Re: python and matlab Sam Adams <cuongpn@gmail.com> - 2014-02-06 06:18 -0800
Re: python and matlab Sturla Molden <sturla.molden@gmail.com> - 2014-02-07 05:28 +0000
Re: python and matlab Rustom Mody <rustompmody@gmail.com> - 2014-02-06 22:06 -0800
Re: python and matlab Sturla Molden <sturla.molden@gmail.com> - 2014-02-07 11:07 +0000
Re: python and matlab pavlovevidence@gmail.com - 2014-02-08 22:30 -0800
csiph-web