Can you just restate the problem?
Sorry. Is there a way to trim the time stamps out of the variable result? The timestamp takes up most of the page width.
Can you just restate the problem?
import sys
import collections
import re
def tail(iterable, N):
deq = collections.deque()
for thing in iterable:
if len(deq) >= N:
deq.popleft()
deq.append(thing)
return list(deq)
# A list of the variable IDs - this script doesn't create them so they have to exist already
variable_ids = [1, 2, 3, 4, 5]
lines = tail(open("/Library/Application Support/Perceptive Automation/Indigo 7/Logs/indigo_log.txt"), len(variable_ids))
for index, line in enumerate(lines):
# if the line starts with the date/time string formatted like this: 2018-02-01 00:00:24.350
if re.match(r'^[0-9]{4}\-[0-9]{2}\-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}', line):
# remove everything from the start of the line through the first tab, which removes the date
line = "\t".join(line.split("\t")[1:])
indigo.variable.updateValue(variable_ids[index], value=line)
Users browsing this forum: No registered users and 3 guests