run function in background?

Damian Menscher menscher+python at uiuc.edu
Fri Jun 8 14:37:30 EDT 2001


Is there a way to run a function in python in the background?
Ideally I'd want something like

def my_func(params):
	stuff here

for i in range(10):
	print "starting a process"
	my_func(params) &

where the & indicates that shouldn't stop the flow of the program,
so the loop would continue and have all 10 go simultaneously.

(Doing this using map() won't work for me, since my actual problem
is a bit more complex.)

Email replies appreciated, since I check email more often than news.

Damian Menscher
-- 
--==## Grad. student & Sys. Admin. @ U. Illinois at Urbana-Champaign ##==--
--==## <menscher at uiuc.edu> www.uiuc.edu/~menscher/ Ofc:(217)333-0038 ##==--
--==## Physics Dept, 1110 W Green, Urbana IL 61801 Fax:(217)333-9819 ##==--



More information about the Python-list mailing list