Python help please

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
Forum rules
This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
jd10884
Posts: 39
Joined: Sat Feb 18, 2012 2:24 pm

Python help please

Post by jd10884 »

Good day,

Looking for a little help with the script below,

The script below will not run the two Indigo lines, I do not get an error in the log. If I replace them with a print command, the script runs fine in Python. Can you tell me why and if it can be changed to run from Indigo?

Code: Select all

import os
import subprocess

# get digitemp outputs
cmd = './digitemp_DS9097U -q -a -o "%R %.4C"'

for outline in os.popen(cmd).readlines():
    outline = outline[:-1].split()
    if outline[0] == '28F4F525030000D1':
        temp = outline[1]
        indigo.variable.updateValue('1wireLR_', str(temp))
        indigo.server.log('digitemp', type =  'notice')
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: Python help please

Post by matt (support) »

From where are you trying to execute this script?
Image
Locked

Return to “Extending Indigo with Plugins and Python”