How to run functions in the background?
Will McGugan
news at NOwillmcguganSPAM.com
Mon May 30 12:28:02 EDT 2005
Ognjen Bezanov wrote:
> Hello
>
>
> I need to find a way to 'fork' a function into the background yet still
> be able to send commands to it.
>
> I am writing a media player, and I have a function which plays the
> media. I want to be able to run this function but to (at the same time)
> be able to send commands from it (e.g. pause, play etc...)
>
> How could I do this?
Put your function in a thread, and add a queue to send your commands.
Look up 'thread' and 'queue' in the help.
Will McGugan
--
http://www.willmcgugan.com
"".join({'*':'@','^':'.'}.get(c,0) or chr(97+(ord(c)-84)%26) for c in
"jvyy*jvyyzpthtna^pbz")
More information about the Python-list
mailing list