Help turning code into a module

D

dylpkls91

Hi all,

I am working on a little program for home automation under the X10
protocol. I have given up using a Palm device for input, so I have
resorted to using voice recognition, which I knew nothing about.
However, I found a nice little script on the internet that does exactly
what I need, and it recognizes phrases with pretty much 100% accuracy.
The script can be found here:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/93025

What I want to do is make this code into a module, so I can use it in
the future. For example:

import voicerecognition as vr
vr.StartRecognition(["one", "two", "three"])
result = vr.GetRecognized()
if result == "one":
print "You said: one"
else:
print "You did not say 'one'."

Any help would be appreciated. I have tried this, but IDLE keeps
freezing whenever I try to use the module with a test script.
Specifically, if anyone could actually turn this into a module for me,
I would be extremely grateful. Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top