← Back to team overview

yade-dev team mailing list archive

Interesting python usage

 

Hi,

For python geeks, this is interesting:

This is the content of my python script file:
  from cvxopt import matrix
  A = matrix(1, (1,4))
  print A

In my C++ functor:
    Py_Initialize();
    FILE *file_1 = fopen("/home/chiab/yadeNew/Branch6/scripts/boon/cvxOpt.py","r+");
    PyRun_SimpleFile(file_1,"/home/chiab/yadeNew/Branch6/scripts/boon/cvxOpt.py");

My simulation has only 2 particles, similar to Chiara's previous discussions.  When I type: O.step(), this appears in the console "[ 1  1  1  1]".    But when I type: O.run(2).  It hangs.  And, when I type O.run(), it fails as well.  If I include Py_Finalize();  it hangs after "O.step()".   What is happening inside YADE that stops me from doing this?


Yours,

Boon
 		 	   		  
_________________________________________________________________
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
https://signup.live.com/signup.aspx?id=60969


Follow ups