pezetem
pezetem

Reputation: 2541

Python - How to know if Matlab is complaining about missing free network license

One of the tools I use at work is Matlab, however due to server license there is limited number of users that can use it at the same time.

I decided to write a short script that will open Matlab - simple script with a infinite loop. Now I want to improve my code a bit, to determine if the Matlab is actually opened (otherwise Licence error pops up).

Easy way would be just to check the process in task manager - unfortunately if error occurs as Matlab.exe process (the same as I would be in case of properly opened program).

So I figured out maybe it would be possible to check the name of the window header to determine if there is error or no. I tried to find some solution on the internet, with no luck. Could You provide me with some hint? Or maybe some other solution to the problem?

Upvotes: 1

Views: 129

Answers (1)

user2987828
user2987828

Reputation: 1137

You can check with

$MATLABROOT/etc/lmstat -c yourlicencefile -a

and parse its output to see if you allocated a license or not to your computer.

Upvotes: 1

Related Questions