#!/usr/bin/python import subprocess import time import serial def get_weight(append_file): while True: #datestr = time.strftime("%F-%H:%m:%S") #print datestr soilstr = "/root/na_workspace/calibration/soil-" + datestr #imgstr = "/root/na_workspace/calibration/img-" + datestr + ".jpeg" outfile = open(soilstr, "w") subprocess.call(["/root/na_workspace/command-line-rpi/sn-util-rpi", "get", "2", "all"], stdout=outfile) outfile.close() #subprocess.call(["streamer", "-o", imgstr]) time.sleep(20)