readline()

readline(limit)
limit : optional upper limit of bytes returned.
Output is the line of data from the file.
fob=open('data.txt','r')
print(fob.readline()) # This is first line
Output is here ( used the data.txt file given at file read() ) Using limit
fob=open('data.txt','r')
print(fob.readline(5)) # This
fob.close()
Multiple lines of data
fob=open('data.txt','r')
print(fob.readline())
print(fob.readline())
Output
This is first line

This is second line
writable()

File Append File Write
Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here





    Python Video Tutorials
    Python SQLite Video Tutorials
    Python MySQL Video Tutorials
    Python Tkinter Video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer