Python help please

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

Posted on
Wed Apr 10, 2013 1:35 pm
jd10884 offline
Posts: 39
Joined: Feb 18, 2012

Python help please

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')

Posted on
Thu Apr 11, 2013 11:27 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Python help please

From where are you trying to execute this script?

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests