How to pass a matlab string as an exclamation point command

pathName = '.../foldername/subfoldername'
scriptName = 'main.py'
How do you issue a command to run some file in that folder without changing your working directory or current folder?
!python (pathName)/main.py &
This fails.
Capture.PNG

1 comentario

I suppose it's not the end of the world to temporarily change the working directory, but isn't there a way to accomplish this without doing that?

Iniciar sesión para comentar.

 Respuesta aceptada

Rik
Rik el 25 de Jul. de 2019
If you use the system function instead of the exclamation point operator you can pass a fully parsed char array.

Más respuestas (0)

Categorías

Más información sobre File Operations en Centro de ayuda y File Exchange.

Preguntada:

el 25 de Jul. de 2019

Respondida:

Rik
el 25 de Jul. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by