Python script help
Python script help
(OP)
Hi,
I need to convert an Abaqus input file into a different file format - to do this I obtained a python script. But I have no idea how to run a python script on a file.I have never used python scripting before.
Could someone please suggest me how could I run a python script on a file (say "abc.inp"). I have installed python 3.0
Thanks in advance,
SS
I need to convert an Abaqus input file into a different file format - to do this I obtained a python script. But I have no idea how to run a python script on a file.I have never used python scripting before.
Could someone please suggest me how could I run a python script on a file (say "abc.inp"). I have installed python 3.0
Thanks in advance,
SS





RE: Python script help
Gurmeet
RE: Python script help
MMS
RE: Python script help
RE: Python script help
I tried both the approaches. But I could not convert my inp file to crk file. I am attaching the Python code and the inp file to this mail (both are in a compressed folder). Could you please take a look at it and let me know what is it I am doing wrong. Flawsurfs.py is the code I need to run.
All I need it to be able to run the Flawsurfs.py code on Crack.inp and generate a .crk file. I greatly appreciate any help you could offer.
Thanks,
Rajesh
RE: Python script help
but I think you can use the FESurfCrack.py like this:
*python FESurfCrack.py -tr 0.005 -inp Crack.inp > MMS.crk*
just run it in command prompt (without stars), you must have python installed.
Good Luck,
Mohammad Shahbazi
www.OmranAfzar.com
RE: Python script help
I tried the command lines but I have been getting syntax error messages. I am surely missing something. I also tried IDLE to run the FESurfCrack module and it is showing some indentation errors. I tried to make them consistent, but they (indentation errors) keep coming.I am attaching the screen shots of the errors I am getting and the python code.
My experience with Python is 'Zero'. I just need to run this file to convert my inp files to crk files. I would greatly appreciate any help in rectifying this problem. I have Python 2.6 installed on my Windows PC.
Thanks again,
SS
RE: Python script help
Dont hesitate to contact me again.
Good Luck,
Mohammad Shahbazi
www.OmranAfzar.com
RE: Python script help
I copied the batch file onto my PC and ran it (just double-clicked the batch file). But, it was just creating an empty (0 bytes) MMS.crk file.
Excuse my ignorance with computers. Am I supposed to edit the batch file ? Like changing the path or something . Please let me know.
The MMS.crk file you sent is exactly what I am looking forward to generate. I would greatly appreciate if you could suggest what are the steps I need to follow. Once again thanks so much for the help.
SS
RE: Python script help
set it and run it again. installing python adds its path to your windows paths.
Good luck,
Mohammad Shahbazi
www.OmranAfzar.com
RE: Python script help
After copying the batch file you sent, to the folder which has the python script I want to run, I set the path to the Python executable in the batch file. Then I ran it. The fact is that it is running; but it is creating a MMS.crk file that is empty.
I am changing the path in the file you sent to something like C:\Python26\ which has the python executable. I will check it again. I may be missing something. Thanks so much for your help. I appreciate it.
RE: Python script help
I modified the path in the batch file as you suggested ( I am attaching the folder with the file). But for some reason, it is not generating the complete MMS.crk file.
I am not sure if it has to do anything with the Python version I have or the way my computer is set-up. Please let me know what you think may be wrong.
Thanks,
Rajesh
RE: Python script help
just run it, it must work.
if not, i can help u interactively through yahoo or skype. my contact details are in my website.
Good luck,
Mohammad Shahbazi
www.OmranAfzar.com
RE: Python script help
Rajesh