⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scripting_6_9__calling_from_the_command_line.html

📁 语音信号处理软件praat教程:这是一部入门教程
💻 HTML
字号:
<html><head><meta name="robots" content="index,follow">
<title>脚本 6.9. 从命令行调用</title></head><body bgcolor="#FFFFFF">

<table border=0 cellpadding=0 cellspacing=0><tr><td bgcolor="#CCCC00"><table border=4 cellpadding=9><tr><td align=middle bgcolor="#000000"><font face="Palatino,Times" size=6 color="#999900"><b>
脚本 6.9. 从命令行调用
</b></font></table></table>
<p>
大多数计算机上都支持从命令行调用Praat脚本。</p>
<h3>
Unix和MacOS X系统的命令行</h3>
<p>
在Unix或MacOS X系统中,可以这样从命令行调用Praat脚本:</p>
<code>
&gt; /people/mietta/praat doit.praat 50 hallo<br></code>
<p>
或者</p>
<code>
&gt; /Applications/Praat.app/Contents/MacOS/Praat doit.praat 50 hallo<br></code>
<p>
这样就能打开Praat并运行脚本<b>doit.praat</b>,向其传递参数“50”和“hallo”,然后关闭Praat。</p>
<p>
此外还可以在命令行上交互式运行程序:</p>
<code>
&gt; /people/mietta/praat -<br></code>
<p>
然后即可立即键入并执行各种固定和动态选单命令,以及用来选中对象的命令,如<b>select</b>。该方法还可以配合管道符操作:</p>
<code>
&gt; echo "Statistics..." | /people/mietta/praat -<br></code>
<h3>
Windows系统的命令行</h3>
<p>
在Windows系统中,可以这样从命令行调用Praat脚本:</p>
<code>
e:\praatcon.exe e:\doit.praat 50 hallo<br></code>
<p>
注意要改用<b>praatcon.exe</b>,而不是<b>praat.exe</b>。脚本可以向控制台输出结果,也可以用管道符重定向。</p>
<h3>
如何向脚本提供参数</h3>
<p>
前面示例中,脚本<b>doit.praat</b>需要两个参数。脚本文件<b>doit.praat</b>使用<b>form</b>与<b>endform</b>结构接收参数。参看<a href="Scripting_6_1__Arguments_to_the_script.html">脚本 6.1. 脚本参数</a>。同使用<b>execute</b>命令的情形相似,Praat不弹出表单窗口,只是用从命令行得到的参数来执行脚本。<a href="Scripting_6_1__Arguments_to_the_script.html">脚本 6.1. 脚本参数</a>一文中所举示例就可以这样调用:</p>
<code>
&gt; /people/mietta/praat playSine.praat 550 0.9<br></code>
<p>
或者</p>
<code>
e:\praatcon.exe playSine.praat 550 0.9<br></code>
<h3>指向本页的链接</h3>
<ul>
<li><a href="Scripting.html">脚本</a>
<li><a href="Scripting_1__My_first_script.html">脚本 1. 我的第一个脚本</a>
<li><a href="Scripting_6__Communication_outside_the_script.html">脚本 6. 脚本外通信</a>
<li><a href="Scripting_8_1__The_sendpraat_subroutine.html">脚本 8.1. 通过sendpraat子程序</a>
</ul>
<hr>
<address>
	<p>&copy; ppgb, April 14, 2004</p>
	<p>&copy; 翻译:徐清白,2005年06月10日</p>
</address>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -