logo-MindMajix
PostPythonPython
p
persis crystal

Posted on 26th July 2024|21 views

0
votes

Python End Of File

How can I find whether my file is eof or not?

1 answers
Answers
P
kumar san

Posted on 26th July 2024| views

Try this

fp = open("abc.txt")

fp b = fp.read() 

if b is None: print 'fp is at the eof'


 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo

  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos
Name
Course *
Email *
Phone Number