On Sun, Jan 28, 2001 at 06:39:40PM +0100, Eduardo Ferro wrote:
> Hi everybody!
>
> I am trying to read some output from a system call, and i was looking
> for it at the mailing list archives,i found some tricks but i can`t
> use it. Now i am using a function run in an other thread with
> thread.start_new_thread
>
> I want to open with the os.popen a file and read from it from the main
> thread, but i don`t know how to do it, because i can`t access to this
> namespace, and i can`t so it with a global varible...
usually, you want to read the file in the new thread and not main.
But if you meant that you want to open the file in main and read
it in the thread, then do this:
thread.fh = os.popen (...)
thread.start_new_thread ()
now the thread can use "self.fh" to access the open file.
--
==============================================
Sowatec AG, CH-8330 Pfäffikon (ZH)
Witzbergstr. 7, http://www.sowatec.com
Tel: +41-(0)1-952 55 55
Fax: +41-(0)1-952 55 66
----------------------------------------------
Aaron "Optimizer" Digulla, [EMAIL PROTECTED]
==============================================
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk