Hi [EMAIL PROTECTED] wrote: > Greetings! > > Is there any way in python to check if a text file is blank?
obviously there are many ways, one simple way is to check length if its None then the file is blank. > > What I've tried to do so far is: > > f = file("friends.txt", "w") > if f.read() is True: > """do stuff""" > else: > """do other stuff""" > f.close() If checking the file is blank is what you are tying to do then why do you open the file in the write mode. Prashanth -- http://mail.python.org/mailman/listinfo/python-list