Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
import webbrowser
import os
import string
import time
from weibo import *
def press_sina_weibo():
APP_KEY = '- - - - - - - - - -' #your app key
APP_SECRET = '- - - - - - - - ' # your app secret
CALLBACK_URL = '- - - - - - - -' #your CALLBACK_URL
import string
tfile = open("/home/pi/minicomfile","r")
text = tfile.read()
length = len(tfile.readline())
tfile.close()
temperaturedata = text.split("\n")[length - 1]
floatdata = string.atof(temperaturedata)
temperature = floatdata / 10
intdata = int(temperature)
intdata = '%d' %intdata