import urllib as ul
from datetime import datetime
# Script used to control number of printed pages by a network printer#
# Made by LEX - 18JUN2010#
infile=ul.urlretrieve ('printer address here',filename='temp_printer.txt')
infile = open('temp_printer.txt', 'r')
html_file=infile.readlines()
infile.close()
t = int(html_file[index])# write index of line storing printed pages
printer = str(t)
now = datetime.now()
now = str(now)
outfile = open('Log_printer.txt', 'a')
outfile.write(hp4200 + '\t' + now[:10] + '\t' + now[11:19] +'\n')
outfile.close()
print ' '
print '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'
if t==0:
print 'no printed pages yet - the tree is safe ! ! !'
else:
print (t*100)/8333.3 , '% of a tree is dead to date ! ! !'
print '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++'
print 'today is: ', now[:10]
print 'time: ', now[11:19]
print ' '