本文整理匯總了Python中system.System.executeNew方法的典型用法代碼示例。如果您正苦於以下問題:Python System.executeNew方法的具體用法?Python System.executeNew怎麽用?Python System.executeNew使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類system.System
的用法示例。
在下文中一共展示了System.executeNew方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __execute3
# 需要導入模塊: from system import System [as 別名]
# 或者: from system.System import executeNew [as 別名]
outFile = tmpFs.absPath("test.wav")
fs.writeFile(tmpFile, "testing")
try:
stdoutData, stderrData = __execute3("text2wav", "--filename=\"%s\"" % outFile,"--textfile=\"%s\"" % tmpFile)
except Exception, e:
print str(e)
if fs.isFile(outFile):
tmpFs.delete()
return True
elif system.isMac:
#try to get environment variable for festival
#need value for cmd
cmd = "festival_client.exe"
stdoutData = ""
try:
stdoutData, stderrData = system.executeNew(cmd, "--output", "nul", "--ttw", stdinData="test\n\x1a\n")
except Exception, e:
return False
return stdoutData.startswith("festival_client")
else:
#test text2wave is working
tmpFs = fs.createTempDirectory()
tmpFile = tmpFs.absPath("test.txt")
outFile = tmpFs.absPath("test.wav")
fs.writeFile(tmpFile, "testing")
try:
stdoutData, stderrData = __execute3("text2wave", "-f", "8000", "-o", outFile, tmpFile)
except Exception, e:
pass
#print "Exception in tts_wrapper: ", str(e)
if fs.isFile(outFile):