Custom Execution from Python

Peter Hansen peter at engcorp.com
Sat Sep 20 02:04:26 CEST 2003


satish wrote:
> 
> I have a shared object executable  viz. *cable*  which I execute as follows :
> $ ansyscust71 -custom cable -p ANSYSRF
> 
> **ansyscust71 is a shell script and is a part of a software called ANSYS**
> 
> Now, I have generated a python module using a *fortran-python interface
> generator called F2PY* using the same *make rules* which were used to make
> *cable* when not using F2PY
> 
> I got a Python extension module named *cable_f2py* again.
> 
> From the python environment when I tried to execute *cable_f2py* ( this is
> python module due to F2PY), I got a segmentation error just like how I would
> get this error when I execute *cable* as follows when not using F2PY:
> 
> $ ./cable
> Segmentation Fault
> 
> However, when I execute it as follows, it works
> 
> $ansyscust71 -custom cable -p ANSYSRF  --> This is required for succesful
> execution
> 
> Now, I dont understand how I can mimic the above way of execution from within
> Python to execute *cable_f2py* which as I mentioned earlier is the result of
> making and linking all the same libraries which were used while making and
> linking cable
> 
> I am really confused

So are we, as most of what you describe above seems to have very little
relationship with Python.  You might need to think through your problem
and attempt to explain it in a different way for us to help you.  For
example, you don't show *how* you try to execute it "from the python 
environment".  Have you got some code to show us?

Anyway, as a bit of a long shot, are you aware of the os.system() function,
and the various other methods of running external executables?  If
you are already using one of those, you might want to show us how you
use it.

-Peter




More information about the Python-list mailing list