By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,814 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,814 IT Pros & Developers. It's quick & easy.

Calling a matlab gui from python using pymatlab without allowing python to close it

P: 15
Before proceeding further, my system configuration is as follows:
Mac OS X 10.6.6
MATLAB 2010b
ActiveState Python 2.7

I have a gui built using matlab. I wrote the following python script
to open that matlab gui using pymatlab python module:

Expand|Select|Wrap|Line Numbers
  1. from pymatlab.matlab import MatlabSession 
  2. session = MatlabSession() 
  3. session.run('cd ~/ratter/ExperPort') 
  4. session.run('addpath(genpath(pwd))') 
  5. session.run('run Utility/WaterMeister/WaterMeister.m') 
  6.  
In the above python code, WaterMesiter.m is the matlab gui script. If
I run this in matlab shell, it opens the gui fine and I do whatever I
need to do with the gui and then close it. Now, instead, if I run the
above python script, everything goes fine but the GUI is closed
immediately as soon as it is opened, and the control is returned back
to python shell. I don't want this to happen. I want the GUI to stay
opened and I want the control to return back to python only when I
close the matlab GUI.

Any thoughts/suggestions will be greatly appreciated.
Jun 8 '11 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.