Hi,

As part of a task i need to verify that last line of a text file is blank.
When i read that file, its getting ignored and i couldn't able to check
that.
Here is the code snippet that i used:

import os
iniFileName = "Config.ini"
iniFile = open(iniFileName, 'r')
lines = iniFile.readlines()
noOfLines = len(lines)
if lines[noOfLines] == "":
 print "Last line is blank"
else:
 print "Last line is not blank"

regards,
Siddhartha
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to