READ TEXT FILE | read(),readline(),readlines() functions | CBSE CLASS - XII | COMPUTER SCIENCE

Опубликовано: 13 Октябрь 2024
на канале: Swati Chawla
89,309
2.5k

How to read data from a text file
Reading data from a text file

In this video, you will learn how to read data from a text file.
read()-Reads at most n bytes ; if no n is specified , reads the entire file.
Returns the read bytes in the form of a string.
readline()-Reads a line of input ; if n is specified reads at most n bytes.
Returns the read bytes in the form of a string ending with ‘\n’ character.
Returns a blank string if no more bytes are left for reading in the file.
realines()-Reads all the lines of a text file.
Returns in the form of list.

Playlist Links:
Sample Papers (Solved)
   • Sample Papers (Solved)  
Python Revision Tour
   • Python Revision Tour  

Functions in Python
   • Working with Functions in Python  

random module
   • random module  

Mathematical and String Functions
   • Playlist  

Using Python Libraries:
   • Using Python Libraries  

Data Structures: Stack and Queue
   • Data Structures : Linear List and Sta...  

File Handling:
   • File Handling  

Recursion
   • Recursion  

Idea of Algorithmic Efficiency
https://www.youtube.com/playlist?list...

Interface Python with MYSQL:
   • Interface Python with MYSQL  

MYSQL
   • MYSQL  
Computer Networks:
   • Computer Networks  

Programming Corner:
   • Programming Corner  
Output Based Questions:
   • Output Based Questions  
Live Sessions (2021):
   • Live Sessions - (2020 - 21)  
Live Sessions (2022):
   • Live Sessions for Term - 1 (2021-22)