Execution of a OS command from a Python daemon
-
09-09-2019 - |
Question
I've got a daemon.py with a callback. How should I make the handler function execute a OS command?
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