← Back to team overview

yade-dev team mailing list archive

Re: Interesting python usage

 

My module name is called solverB.py  I can't do pyRunString("module.function()") because it has to take in arguments as input.  So, I'm doing this:

pName = PyString_FromString("solverB");
pDict = PyModule_GetDict(pModule);
pModule = PyImport_Import(pName);
pFunc = PyDict_GetItemString(pDict, "functionName");
rslt = PyObject_CallObject(pFunc,args);   <--args is the arguments for pFunc, and has been parsed frm C to python

The simulation is extremely slow.  Is it because I am using a lot of O.bodies.state by assessing the getScene() pointer? Or is it because python module is compiled everytime i call it?  


Yours,

Boon

----------------------------------------
> From: eudoxos@xxxxxxxx
> To: yade-dev@xxxxxxxxxxxxxxxxxxx
> Date: Sun, 4 Apr 2010 13:44:34 +0200
> Subject: Re: [Yade-dev] Interesting python usage
>
>> Going back to the question, where is yade declared as a module? it's not declared in PYTHONPATH in .bashrc.
> Read docs for sys.path and use it instead of PYTHONPATH
> (sys.path.append('.')); do you expect all people using your script to
> mess with their .bashrc?
>
> Have a look inside yade's executable, you'll see how it works.
>
> v
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help : https://help.launchpad.net/ListHelp
 		 	   		  
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969


Follow ups

References