Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How do i run python file from cmd?

Status
Not open for further replies.

loki3000

Mechanical
Sep 29, 2009
652
Hello,

i have a script that accesses the odb and gets some data from it. if i try to run it in abaqus (execfile()) it runs just fine, but if i run it from the cmd prompt, i get an error that there is no module by name odbAccess.
any idea how can i make it work? i've got no way of editing the path information (linux), so that won't do. Would the executeOnCaeStartup() function be of any use (that's IF i can access it)? i have the #!/usr/bin/python in the beginning of the file, yes.

any other ideas?
 
Replies continue below

Recommended for you

Hi,

To run a script with modules delivered by Simulia (e.g. odbAccess) you need to run python which is installing with Abaqus.
With "#!/usr/bin/python" line you are try to run python delivered with operating system.
Please try command:
abaqus python script_filename.py

Regards,
akaBarten
 
is it possible to reference the abaqus' version of python? such as #!/opt/abaqus/6.9-1...?
to what do i reference it? to Commands directory or /6.9-1/Python? (since abaqus python is technically run from the Commands directory, at least on winse).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor