PDA

View Full Version : How to import the defaultdict into vizard


knightgba
07-25-2010, 03:30 PM
Hi, guys

I have got a chance to play with vizard in my univ lab. its quite nice
I already have had some experience in writing python scripts(very basica ones)

Here I have meet some problems.

First I want to use defaultdict(sets) in vizard to do some dirty work, but it seems viz doesn't know Python module collections and the following codes don't work

from collections import defaultdict
So I just want to know is it possible to use collections module in vizard? or viz has already got some build-in structure like defaultdict(sets) in python.

Second, I also want to add voice recognition element into my vizard scripts to make some nice VR demonstrations. Under pythonwin I can do this by using Microsoft Speech SDK(using COM). But I am not sure whether I can do the same thing in Vizard. So If its possible, could anyone give me some hints or advice. Appreciate a lot!
:D:D

TarkaDahl
07-25-2010, 04:31 PM
Hi

I dont think you can use defaultdict in viz as its only available in version 2.5 of python and vizard uses version 2.4.

There are some collections you can use see http://docs.python.org/library/collections.htm

For voice recognition look at this thread http://forum.worldviz.com/showthread.php?t=2790

Thanks

knightgba
07-26-2010, 05:18 AM
thx for reply!
its quite helpful!
it seems I need check the 2.4 reference to modify my code.

knightgba
07-26-2010, 01:35 PM
It seems in python 2.4 deque is available, think I can use it instead of defaultdict(sets)