Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > how to communicate in python with an external process

Thread Tools

how to communicate in python with an external process

Danny Shevitz
Posts: n/a

I'm a long time python user but ran across something I have never needed to do
before and don't know how to do it.

The issue is that I need for my python script to call some matlab routines.
Matlab is very expensive to start running, so I only want to run it once. I also
want the changes I make in one call to matlab persist to the next call to matlab.

I don't know how to do this. What I want to do is something like create a matlab
process, get it's pid and then attach later (this can be in blocking mode) to
that pid to execute the command, read the output, then go on in my python code
and at some point later, repeat the process of attaching to the persistent
matlab pid...

I am familiar with subprocess.Popen, but I don't understand how to attach to a
pid, as opposed to creating a new matlab instance every time.

Any enlightenment would be appreciated.


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
communicate with external process via pty Tim Arnold Python 3 10-10-2012 07:23 PM
Re: how to communicate in python with an external process Benjamin Kaplan Python 1 06-07-2011 08:46 PM
Using Python with COM to communicate with proprietary Windows software Joakim Persson Python 8 09-21-2005 01:05 PM
anybody know how to use python to communicate with UART? Arnold Python 2 12-13-2004 04:45 PM