On 2006-08-04, Rochester <[EMAIL PROTECTED]> wrote:
> Thank you for your advise.  So, it turns out that fifos are quite useless  
> in Python programming then, which is quite disappointing to me :-(
>
> I am not saying that I _have to_ use fifo, afterall it is a rather odd  
> thingy not in fasion since the last iceage... I am just disappointed by  
> the fact that the old plain Bash seems to excel Python in this special  
> aspect.

It doesn't.

> I am new to Python and much more comfortable in Bash programming.  A  
> simple Bash script like this would take the advantage of a fifo, hence  
> reduce the overhead of unneccesarry temporary files creation:
>
> #!/bin/bash
>
> mkfifo my_fifo
> echo "this is a string in my fifo!" > my_fifo &
> cat my_fifo
> rm my_fifo
>
> Isn't it neat?

Look you put the echo in the background, because otherwise your script
would block. Nothing stops you from starting a thread in python to open
the fifo in write mode, the thread would block but the main program
could still continue.

There also is the os.pipe and os.popen calls that may be more usefull
in specific cases.

-- 
Antoon Pardon
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to