2011-02-02 2 views

답변

0

여기에 언급 한 바와 같이

import time 
import pythoncom 
while True: 
    pythoncom.PumpWaitingMessages() 
    time.sleep(.1) 

가 와야합니다 https://pythonhosted.org/dragonfly/

from dragonfly.all import Grammar, CompoundRule 

# Voice command rule combining spoken form and recognition processing. 
class ExampleRule(CompoundRule): 
    spec = "do something computer"     # Spoken form of command. 
    def _process_recognition(self, node, extras): # Callback when command is spoken. 
     print "Voice command spoken." 

# Create a grammar which contains and loads the command rule. 
grammar = Grammar("example grammar")    # Create a grammar to contain the  command rule. 
grammar.add_rule(ExampleRule())      # Add the command rule to the grammar. 
grammar.load()          # Load the grammar. 

에서 코드 예제를 제공하면서 샘플 코드는 코드 조각에 나가 그리워 잠자리를보고 할 수 있습니다 - http://dragonfly.googlecode.com/svn-history/r46/trunk/dragonfly/examples/dragonfly-main.py