私は2.7を実行しており、pyinstallerを使用しています。私の目標は、exe を出力し、それで他のクラス ファイルを実行することです。音声認識のフレームワークとしてhttps://code.google.com/p/dragonfly/も使用しています。例の方向に、dragonfly->examples->text.py の下に別のファイルを作成しました。IDEでhttps://code.google.com/p/dragonfly/source/browse/trunk/dragonfly/examples/dragonfly-main.py?spec=svn79&r=79を実行すると、音声コマンドを言うことができ、理解します私が作成した以下のファイルと、トンボの例にある他のサンプルファイル。
from dragonfly.all import Grammar, CompoundRule, Text, Dictation
import sys
sys.path.append('action.py')
import action
# Voice command rule combining spoken form and recognition processing.
class ExampleRule(CompoundRule):
print "This works"
spec = "do something computer" # Spoken form of command.
def _process_recognition(self, node, extras): # Callback when command is spoken.
print "Voice command spoken."
class AnotherRule(CompoundRule):
spec = "Hi there" # Spoken form of command.
def _process_recognition(self, node, extras): # Callback when command is spoken.
print "Well, hello"
# 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.add_rule(AnotherRule()) # Add the command rule to the grammar.
grammar.load()
# Load the grammar.
コンソールで出力されることに気付きました
UNKNOWN: valid paths: ['C:\\Users\\user\\workspace\\dragonfly\\dragonfly-0.6.5\\dragonfly\\examples\\action.py',etc..etc...
pyinstaller を使用した後、その行の出力は
UNKNOWN: valid paths: []
そのため、サンプルが見つからないため、サンプルをロードしていません。exeを作成するときにサンプルファイルもロードするようにpyinstallerに指示するにはどうすればよいですか? そして、ファイルがロードされる場合、exeがファイルの場所を認識していることを確認するにはどうすればよいですか?
私がpyinstallerのために実行しているコマンド
C:\Python27\pyinstaller-2.0>python pyinstaller.py -p-paths="C:\Users\user\worksp
ace\dragonfly\dragonfly-0.6.5\dragonfly\examples\test.py" "C:\Users\user\workspa
ce\dragonfly\dragonfly-0.6.5\dragonfly\examples\dragonfly-main.py"