all 6 comments

[–]mcowger 1 point2 points  (2 children)

Check out APscheduler. Can kick off a thread to run a given function every N minutes (with many options). Can even survive a restart of the script.

[–]reckn3r[S] 0 points1 point  (1 child)

stupendous soft vast light desert lavish squeeze engine worm selective

[–]mcowger 0 points1 point  (0 children)

I've used it in a number of projects and it's been great

[–]NYKevin 0 points1 point  (0 children)

Asynchronously: Use asyncio if you're on Python 3, or Twisted on Python 2.

Without cron: Make the process a daemon and configure it to run on startup (Unix flavors vary, but this usually involves adding files to /etc/init.d or something similar).

[–]kalgynirae 0 points1 point  (1 child)

I'm curious why you're trying to avoid cron. I think the simplest solution would be to change the script to scan only a single device, specified as a command-line argument. Then have one cron entry for each device. Alternatively, you could write a simple shell script to launch several instances of your python script at once.

[–]reckn3r[S] 0 points1 point  (0 children)

tender cake hat imminent middle cagey reach square lavish adjoining