On Jan 7, 2011, at 8:50 PM, David Hutto wrote:
> On Fri, Jan 7, 2011 at 8:44 PM, TR Shaw <[email protected]> wrote:
>>
>> On Jan 7, 2011, at 8:36 PM, David Hutto wrote:
>>
>>> I'm with some of the others above on using Python. Writing a command
>>> line app is about as simple as:
>>>
>>> import subprocess
>>> word = 'hello'
>>> self.espeak = subprocess.Popen(['espeak', word], stdout =
>>> subprocess.PIPE).communicate()[0]
>>>
>>> I think of PHP as more browser, than desktop app/webapp.
>>
>>
>> And in php the above is just:
>>
>> echo "hello";
>>
>> Which is simpler? The answer is the one that you are most comfortable with.
>
> I expect this might have been meant to go to the list, but I'll reply
> directly back.
>
> With the espeak installed. This calls a command line from your python
> script, and speaks the word, not just display. I understand this might
> be direct with certain abilities to display and speak the info.
> In python2.x it would be
>
> print 'hello', or print "hello", notice no ';'.
>
> How would you call a command line(from terminal) script from within a
> php desktop app? That was what the above was meant to demonstrate in
> python, not print it out to page, or terminal. But I'm guessing it
> might not be that different.
Sorry, David I should not reply quickly when I have a cold but again its all
pretty similar. Here it is on unix/linux.
PHP:
$word = "hello";
exec("say \"$word\"");
Bash:
word="hello"
say "$word"
In all the languages its hust:
1) set a variable
2) call an external program with the variable as an argument
after that its all about language specific syntax.
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php