Plato P.B. wrote:
Hi all,
I have created a script in which i need to implement the communication
between the main program and a thread.
The thread looks for any newly created files in a particular directory. It
will be stored in a variable in the thread function. I want to get that name
from the main program.
How can i do it?

Thanks in Advance. :D
Don't store it in "a variable in the thread function," but in an instance attribute of the thread object.

Then the main program simply checks the object's attribute. Since it launched the thread(s), it should know its (their) instances. This way, the solution scales up as you add more threads, with different functionality.

DaveA

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to