views:

166

answers:

1

I've got a daemon.py with a callback. How should I make the handler function execute a OS command?

A: 

when i learned Python some time ago, I used:

import os
os.system('ls -lt')

but it seems like in Python 3.x, the recommended use is commands or os.popen()

動靜能量
don't use os.system. It's recommended to use subprocess.Popen instead.
nosklo