El Mon, Jan 29, 2001 at 04:33:48PM +0100, Aaron Optimizer Digulla dijo:
> 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.
Thanks for the info!
I now should kill externaly (from the main thread) the new thread
generated by the start_new_thread function, now in the new thread i
get the tid with get_ident and save it at global variable (bad
practice i know, but it`s only for testing :-))
But i didn`t found a method to kill the thread like i usualy do in C
Somobody know how to do this???
--
Hasta otra!
Eduardo Ferro Aldama [EMAIL PROTECTED]
(Linux User 58390-44335) [EMAIL PROTECTED]
La web del GLUB http://glub.ehu.es/
Grupo Linux Usuarios de Bizkaia
Mecagüenlap#&%$$... se ha cagao el ratón en la almohadilla!!
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk