Skip to content

Instantly share code, notes, and snippets.

@akira093
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akira093/9214676 to your computer and use it in GitHub Desktop.
Save akira093/9214676 to your computer and use it in GitHub Desktop.
#coding:utf8
import pylab
import subprocess
import time
pylab.ion()
l = []
def getTemp():
x = subprocess.Popen("sensors", stdout=subprocess.PIPE, shell=True)
return float(x.stdout.readlines()[8][16:21])
while True:
if len(l) > 30:
l.pop(0)
pylab.gcf().clear()
pylab.ylim(0, 100)
pylab.xlabel("time")
pylab.ylabel("degree")
l.append(getTemp())
pylab.plot(pylab.arange(- len(l) + 1, 1), l)
pylab.draw()
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment