Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] python namespace

Date2006-04-26 15:27
FromMichael Gogins
SubjectRe: [Cs-dev] python namespace
In your Python code, did you import all the XSI modules that you need? Even if Python embedded in an app that has a Python console or interpreter, you normally still need to import all modules you intend to use. Of course, I assume you have done this.

Another thing is different styles of import. "from namespace import *" is not the same as "import namespace". In the former case, you call "function(args)" in the latter case you call "namespace.function(args)". Possibly inside SoftImage, one style is used and you are trying to call using the other style.

However, it may additionally be the case that XSI has a dynamically built namespace. In other words, classes are defined at some point during run time, not in an import statement. If so, you need to find WHEN that happens. If you identify this and gain access to the class objects, you can dir them to see what methods are available. You can do a top-level 'dir()' to see what modules have been loaded or built.

Also, of course, you could submit your question to SoftImage lists or forums.

Regards,
Mike

-----Original Message-----
>From: Jonathan Mackenzie 
>Sent: Apr 26, 2006 6:49 AM
>To: csound-devel@lists.sourceforge.net
>Subject: [Cs-dev] python namespace
>
>Hello,
>
>I'm trying to run csound 5 from within Softimage XSI  via python. XSI 
>has an an embedded python interpreter for scripting, and I can import 
>csnd, load orchestras and perform OK from there. (This seems to me why 
>python is such a good thing!)
>
>My plan is to use the python opcodes pyrun and pyeval to communicate 
>with XSI objects so that I can synchronise sound synthesis with graphics 
>animation. However, the XSI python namespace is not available to the 
>python I call with the opcodes. This is true whether or not I use 
>pyinit. I have no problems getting the python opcodes to see the 
>namespace of other python code when I run a standalone python program. I 
>can only guess the problem is something to do with XSI already embedding 
>Python. Could anyone give me some pointers on how I might solve this?
>
>Any help much appreciated,
>Mac
>
>
>-------------------------------------------------------
>Using Tomcat but need to do more? Need to support web services, security?
>Get stuff done quickly with pre-integrated technology to make your job easier
>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel





-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net