Hi Scroggsy. I just heard the beeping noise and I checked out the KLB fax. Twitting about points is wonderful!
But wouldn't it make sense to move point counting to a separate class instead of having the following lines everywhere:
def generate_content(self):
import json
with open('/home/pi/.klb/points') as f:
data = json.load(f)
house = "Slytherin"
if house in data:
data[house]+=2
else:
data[house]=2
with open('/home/pi/.klb/points','w') as f:
json.dump(data,f)
from twitter import update_status
update_status(status="2 points to Slytherin!")
Hi Scroggsy. I just heard the beeping noise and I checked out the KLB fax. Twitting about points is wonderful!
But wouldn't it make sense to move point counting to a separate class instead of having the following lines everywhere:
?