Skip to content

Commit 5522250

Browse files
author
Yann
committed
Add steps to runme file to setup python and automate as startup script in the project
1 parent 290362f commit 5522250

File tree

6 files changed

+26
-3
lines changed

6 files changed

+26
-3
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Info File="runme.m" GroupUUID="default" Icon="" Name="runme" Type="StartUp" Visible="0">
3+
<Extension Name="StartUpPrev" Value="HEAD"/>
4+
</Info>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Info location="89a2a5cc-1383-4cf9-8298-ba7852a76583" type="EntryPoint"/>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Info>
3+
<Category UUID="FileClassCategory">
4+
<Label UUID="design"/>
5+
</Category>
6+
</Info>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Info location="setup_python.m" type="File"/>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<Info location="Root" type="EntryPoints"/>

runme.m

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@
1111

1212
% MATLAB may crash with python process - use "OutOfProcess" execution mode
1313
% could avoid that
14-
pyenv("ExecutionMode","OutOfProcess");
15-
14+
p = pyenv;
15+
if p.Status ~= "Loaded"
16+
pyenv("ExecutionMode","OutOfProcess");
17+
end
18+
19+
if system('pip --version') == 127 % pip: command not found
20+
setup_python
21+
end
22+
1623
py.importlib.import_module('detectHuman');
1724

1825
pathToPyfun = fileparts(which('detectHuman.py'));
1926
if count(py.sys.path,pathToPyfun) == 0
2027
insert(py.sys.path,int32(0),pathToPyfun);
21-
end
28+
end

0 commit comments

Comments
 (0)