I would like to convert this Matlab code to Python syntax. The aim of this code is to executing a shell command via Matlab to run an abaqus simulation with a specific target.
string = ['C:\Windows\System32\cmd.exe /E:ON /V:ON /K' ...
'""C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.8.254\windows\bin\ipsxe-comp-vars.bat" intel64 vs2013 & abaqus ' ...
'j=v1 '...
'inp=v1.inp '...
'user=vumat_randomFields_v3.for '...
'int & exit"'];
job1 = system(string);
I tried to use subprocess module ,but I did not succeed .
import subprocess
string = [r'C:\Windows\System32\cmd.exe','/E:ON','/V:ON','/K',
r'"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.8.254\windows\bin\ipsxe-comp-vars.bat" intel64 vs2013 & abaqus',
'j=v2',
'inp=v1.inp',
'user=vumat_randomFields_v3.for',
'int', 'exit']
command='abaqus job=v1 user=vumat_randomFields_v3 verbose=2 int'
job1 = subprocess.call(command, shell=True)
I did not get any python error; however, the job did not run. Via matlab the job normally ran.
To mention I am using Windows and python 3.10
I would appreciate any help. Best Regards