Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Abaqus python failed to use os.system to call external executable

ratu1997

Student
Dec 29, 2024
2
Hi all,

I programmed a python script. In this sctipt, the abaqus model was created via python and os.system() was used to call an external executable to generate necessary file which can be used in abaqus input file.

After that, I launched abaqus command, and type in 'abaqus cae nogui=myscript.py'. It ran smoothly except the os.system('external.exe'). It seems that external.exe was not executed in the script.

The external executable was programmed in fortran and built by visual studio. And this executable had been placed in the abaqus work directory.

However, if i switch to run os.system(external.exe) in normal python editer (for example in pycharm or spyder) rather than running the script in abaqus command, the executable can run successfully.

Now I am confused why os.system in abaqus python did not execute this external executable.

Kind regards,
ratu
 
Replies continue below

Recommended for you

How about this ?

Python:
import subprocess
subprocess.run("external.exe", shell=True)
 

Part and Inventory Search

Sponsor