Try using subprocess , but without the os.call option. You can use this method to start Abaqus in the background:
import subprocess path = location of file in any directory abaqusCall = 'abaqus job=file_name cpus=2' runCommand = 'cmd.exe /c ' + abaqusCall process = subprocess.Popen(runCommand, cwd=path)
The problem with Abaqus is that it takes a long time to run the analysis, so if you try to run the file "python_name.py" to get the results, the program may get errors because the * .odb file is either not yet created or does not contain data requiring extraction.
You can use the command:
process.wait()
to tell Python to wait for Abaqus to complete the analysis before executing your "python_name.py", but this will cause your python (or GUI) command to hang until Abaqus is completed, which will take a long time.
One of the methods I use is to read the Abaqus * .sta file, which has solution time and progress. That way, you can write a sequence to read the file every 5 seconds, for example, and keep track of when the job ends before executing the result file.
Another trick for extracting data is that as long as you do not use (import) classes from the CAE module, you can run your Python script with this command:
#get results and write them to myresults.txt os.system('abaqus python python_name.py')
Nader source share