On Fri, Oct 15, 2010 at 12:04 AM, Patrick Shirkey <[email protected]> wrote: > In a bit of a time crunch. Can anyone tell me how to do this properly? > > I would like to have a threaded timer to run "cmd" after 5 seconds. > However cmd is normally triggered like this: > > os.system(cmd) > > But there seems to be an issue with calling os.system(cmd) from > subprocess.popen. > > ... > t = threading.Timer(5.0, self.do_popen(cmd))
This line seems to be your problem. You need to give threading.Timer the function to be called, but instead your *calling* do_popen immediately. After five seconds the timer then tries to call the return value of do_popen, which is None. One possible solution would be: t = threading.Timer(5.0, functools.partial(self.do_popen, cmd)) Dominic _______________________________________________ Linux-audio-dev mailing list [email protected] http://lists.linuxaudio.org/listinfo/linux-audio-dev
