[Tutor] Python and Abaqus

Knacktus knacktus at googlemail.com
Fri Jul 30 15:20:32 CEST 2010


Am 30.07.2010 13:44, schrieb leo.ruggiero81 at libero.it:
> Dear All,
>
> I am trying to have access to the Abaqus kernel by a Python script. My
> intention is to avoid to use the Abaqus GUI (or command line) to run a
> simulation.
> The idea is to lunch the Python script by DOS or Python module.
>
> The problem is that my Python script runs from the Abaqus command line or from
> the GUI (menu-->file-->run script) but it doesn't run from outside.

Without knowing very much about the Abaqus command line my guess is that 
a special environment (env. variables, path, etc.) is set up for the 
Abaqus command line. In that case you need to create that environment in 
your DOS command window where the python script is to run or create that 
environment within your python script (see the os module in the standard 
library).
But prior to that you need to know more about the environment. You could 
query the Abaqus command line (if it's a DOS window by invoking the 
python shell then using os.environ, if it's a Python you can use 
os.environ directly after importing os, of course).
Alternatively you could examine the command file, *.bat file or whatever 
opens the Abaqus command shell. Probably that file has a lot of set up 
stuff in it.

HTH and cheers,

Jan



More information about the Tutor mailing list