(filename,linesback)
return lines[start:len(lines)-1]
python tail - modified from recipe at 
		http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/157035
		returns list of [linesback] lines from end of [filename]
python tail - modified from recipe at 
		http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/157035
		returns list of [linesback] lines from end of [filename]
python tail - modified from recipe at http : // aspn . activestate . com / ASPN / Cookbook / Python / Recipe / 157035 returns list of [ linesback ] lines from end of [ filename ]
def tailLines(filename,linesback):
	"""python tail - modified from recipe at 
		http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/157035
		returns list of [linesback] lines from end of [filename]"""
	avgcharsperline=150
	
	file = open(filename,'r')
	while 1:
		try: file.seek(-1 * avgcharsperline * linesback,2)
		except IOError: file.seek(0) 
		if file.tell() == 0: atstart=1 
		else: atstart=0
		lines=file.read().split("\n")
		if (len(lines) > (linesback+1)) or atstart: break
		#The lines are bigger than we thought
		avgcharsperline=avgcharsperline * 1.3 #Inc avg for retry
	file.close()
	
	if len(lines) > linesback: start=len(lines)-linesback -1
	else: start=0
	return lines[start:len(lines)-1]
def tailLines ( filename , linesback ) : avgcharsperline = 150 file = open ( filename , 'r' ) while 1 : try : file . seek ( - 1 * avgcharsperline * linesback , 2 ) except IOError : file . seek ( 0 ) if file . tell ( ) == 0 : atstart = 1 else : atstart = 0 lines = file . read ( ) . split ( "\n" ) if ( len ( lines ) > ( linesback + 1 ) ) or atstart : break #The lines are bigger than we thought avgcharsperline = avgcharsperline * 1.3 #Inc avg for retry file . close ( ) if len ( lines ) > linesback : start = len ( lines ) - linesback - 1 else : start = 0 return lines [ start : len ( lines ) - 1 ]