#!/usr/bin/env python ############################################################################ # # # Author: Andrew Ferguson # # Script written for election.princeton.edu run by Samuel S.-H. Wang under # noncommercial-use-only license: # You may use or modify this software, but only for noncommericial purposes. # To seek a commercial-use license, contact sswang@princeton.edu # ############################################################################ import time efile = open("../matlab/Sen_estimates.csv") values = efile.read()[:-1].split(",") efile.close() dem_mode = values[0] gop_mode = values[1] probDem60 = float(values[2]) sendisplay = open("senate_current.html", "w") sendisplay.write('\tSenate: %s D/I, %s R
\n' % (dem_mode, gop_mode)) sendisplay.write('\tChance of >= 60 seats: %.1f%%
' '\n' % probDem60) sendisplay.write('\tHouse: 257 D, 178 R (+/- 3)
') sendisplay.close()