#!/usr/bin/python import os """ Code to read logged temperature with the corresponding date and time from an ibutton with it mounted to a fuse file system. this code for what it's worth is released under the gpl Copyright (c) 2010 Norman Elliott. All rights reserved. This program or module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or version 3 of the License, or (at your option) any later version. It is provided and is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. """ basedir = os.path.expanduser("~") m = 0 counter = 2047 while m <= counter: mytime = basedir + '/1-wire/21B5FB22000000/log/date.' + str(m) myval = basedir + '/1-wire/21B5FB22000000/log/temperature.' + str(m) fptemp = open(myval, 'r') ptemp = fptemp.readline() fptime = open(mytime, 'r') ptime = fptime.readline() mx = ptime + " - " + ptemp + " " + str(m) print (mx) fptemp.close() fptime.close() m += 1