Run abaqus script from Python interpreter
Run abaqus script from Python interpreter
(OP)
Hi all,
At the moment I am running my Abaqus scripts through CAE using file -> run script -> scriptname.py
Is any code I can use in my python script to run it outside of CAE straight from the python interpreter?
Thanks.
At the moment I am running my Abaqus scripts through CAE using file -> run script -> scriptname.py
Is any code I can use in my python script to run it outside of CAE straight from the python interpreter?
Thanks.





RE: Run abaqus script from Python interpreter
I usually use 'subprocess' module in python:
import subprocess
process = subprocess.call('abaqus cae noGUI=yourscript.py',shell=True)
RE: Run abaqus script from Python interpreter
http://www.eng-tips.com/faqs.cfm?fid=376
http://www.eng-tips.com/faqs.cfm?fid=1083
RE: Run abaqus script from Python interpreter
What I currently do is write my python code in an IDE. When I write normal python code I can run it straight from the IDE at a click of button. I am wondering if there is anyway I can do this for Abaqus-python scripts.
Thanks for your help, and patience
RE: Run abaqus script from Python interpreter
http://www.eng-tips.com/faqs.cfm?fid=376
http://www.eng-tips.com/faqs.cfm?fid=1083
RE: Run abaqus script from Python interpreter
1) I have had issues with opening text files and writing to text files (even though I use close file commmands. There I have had to use a sys.exit() command at the end of script to make sure all the files close. Python experts tell me that this is a problem with the way that Windows handles files opened from python. Anyways, what this means for me is that when I run a script from Abaqus CAE or the command line in Abaqus, then abaqus shuts down once the script has finished. Therefore everytime I want to re run the script I have to reopen abaqus, find the script in the file directory, etc etc.
2) Speed and convenience, I like using an IDE and running python code directly from it, I find it helps save time when I am developing and debugging.
I hope that makes sense, I look forward to further discussion.
Thanks.
RE: Run abaqus script from Python interpreter
http://www.eng-tips.com/faqs.cfm?fid=376
http://www.eng-tips.com/faqs.cfm?fid=1083