open software and run script via command line

2 vues (au cours des 30 derniers jours)
Jennifer Rütsche
Jennifer Rütsche le 21 Déc 2022
Modifié(e) : Jonas le 21 Déc 2022
My code should:
  • open MakeHuman software in background
  • run a python script
  • software has to stay open while matlab code continues to run
path_local_script = 'C:\Users\...\Documents\makehuman\v1py3\scripts\read_BVHpose.py'
command = ['C:\Users\...\AppData\Local\makehuman-community\Python\pythonw.exe ' 'C:\Users\ruetschj\AppData\Local\makehuman-community\mhstartwrapper.py' ' -b ' '--python ' path_local_script ];
system(command);
However, the MakeHuman software is starting, but neither the 'path_local_script' script is run, nor the code goes on afterwards.
What am I doing wrong? Is it not possible to run a script as I'm running MakeHuman from source?

Réponses (1)

Jonas
Jonas le 21 Déc 2022
Modifié(e) : Jonas le 21 Déc 2022
without looking into the detail, you have to chain commands in the system commands using a & sign
also: use the output arguments of the system commands to catch the output/messages from the system command
[a,b]=system('echo hello & echo world')
a = 0
b =
'world hello '

Catégories

En savoir plus sur Call Python from MATLAB dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by