Question

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

Was it helpful?

Solution

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()

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top