5.1 Executing scripts

You have seen how to execute Python statements from the stand-alone Python interpreter. If your script does not access the functionality of ABAQUS/CAE, you can run the script by typing abaqus python scriptname.py at the system prompt. ABAQUS will run the script through the Python interpreter and return you to the system prompt.

If your script accesses the functionality of any of the ABAQUS/CAE modules, the statements must be interpreted by the ABAQUS/CAE kernel; you cannot run the script from the Python interpreter invoked from the system prompt. You must execute the script in ABAQUS/CAE by selecting FileRun Script from the main menu bar and selecting the file to execute. In addition, the script must contain the following statements:

from abaqus import *
from abaqusConstants import *

If your script accesses and manipulates data in an output database, you can execute the script using either of the methods already described: