From a6ceb2b3cc5006a4bae5edeaf3c572552ffe28cd Mon Sep 17 00:00:00 2001 From: Balthasar Reuter Date: Sat, 20 Jun 2015 00:46:28 +0200 Subject: [PATCH] threading seems to work with the minimum threading module --- slideshow.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/slideshow.py b/slideshow.py index d635cc5..182ce94 100755 --- a/slideshow.py +++ b/slideshow.py @@ -7,7 +7,7 @@ import os from datetime import datetime from time import sleep import subprocess -from threading import Thread +import thread ##################### ### Configuration ### @@ -92,15 +92,14 @@ class Slideshow: def routine_command(cmd, interval): while True: print("Running routine") - #output = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) - #print("Output is " + output) + output = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) + print("Output is " + output) sleep(interval) def main(): - show = Slideshow(display_size, display_time, directory, True) - sync = Thread(target=routine_command, args=("/bin/echo 'Routine executed'", 5) ) + thread.start_new_thread(routine_command, ("rsync -rt " + directory + "/ slideshow/", 3)) - #sync.run() + show = Slideshow(display_size, display_time, directory, True) show.run() sync.join()