On Tue, Jun 10, 2003 at 02:27:46PM +0000, Jean-Baptiste Cazier wrote:
> Sæll 
> 
> Thanks for the advices.
> I could nail down the problem to a much smaller test program which shows "conflict" 
> between rsh and the os.system() (see below)
> It looks indeed like a general python problem: 

I think it is a general "rsh" problem.

> I use os.popen in place of os.system. However it does  not solve the rsh problem 
> which is still stopping at the start
> It is solved by ssh but this one keeps on asking for my password !
> 
> 
> Any solution to that problem ?

Use the '-n' switch of rsh or redirect stdin to /dev/null.
Otherwise rsh will always try to read from stdin and send
it over, even if the remote program itself doesn't read
from stdin. This will in general stop any background process.

> 
> Kveðja
> 
> Thanks
> 
> Jean-Baptiste
> PS: Still using python1.5 and pygtk 0.6
> 
> ------------------------------------------
> #!/usr/bin/python
> 
> import os
> import string
> 
> def main():
> 
>   print "start rsh"
>  # os.system('rsh lcs301 "ls" ')
>   try:
>     lines = string.split(os.popen('rsh lcs301 "ls|head" ').read(),'\n')

Replacing the above with

      lines = string.split(os.popen('rsh -n lcs301 "ls|head" ').read(),'\n')


Made this work on my system. Which is Debian with python 2.2 and gtk 1.99.16
I hope it works for you too.

>   except :
>     print "error"
>  
>   for i in lines[:-1]:
>     print i
>   return 0
> 
> if __name__ =="__main__":
> 
>   main()
> 

-- 
Antoon Pardon
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to