×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How do i run python file from cmd?

How do i run python file from cmd?

How do i run python file from cmd?

(OP)
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?

RE: How do i run python file from cmd?

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

RE: How do i run python file from cmd?

(OP)
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).

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources