how to communicate in python with an external process

Discussion in 'Python' started by Danny Shevitz, Mar 7, 2011.

  1. Howdy,

    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.

    thanks,
    Danny
    Danny Shevitz, Mar 7, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnold
    Replies:
    2
    Views:
    3,121
    Fuzzyman
    Dec 13, 2004
  2. Joakim Persson
    Replies:
    8
    Views:
    1,377
    Paul Casteels
    Sep 21, 2005
  3. Arnar
    Replies:
    0
    Views:
    529
    Arnar
    Dec 13, 2007
  4. Benjamin Kaplan
    Replies:
    1
    Views:
    669
    imperialguy
    Jun 7, 2011
  5. Tim Arnold
    Replies:
    3
    Views:
    130
Loading...

Share This Page