Welcome to the Part 3 of the Chapter File Handling for class 12 CBSE Computer Science .
In this video I have discussed how to read data from text files in Python. For reading data from a text file, the file must be created before extraction. After creating the file ,data from the file is being extracted and displayed using the functions read( ) , readline() and readlines( ) .
If you haven't watched the other parts of this Chapter , you may watch them by clicking on the links below 👇:
👉 Part 1 Introduction to Data file handling in python
• #1 Introduction to Data File Handling...
👉 Part 2 Introduction to text files in python
• #2 Introduction to Text Files | File ...
👉 Part 4 Writing and appending data into text files in python
• #4 Writing and Appending Data into Te...
👉 Part 5 Data Manipulation in text files in python
• #5 Data Manipulation in Text Files | ...
👉 Part 6 Reading and Writing data into csv files in python
• #6 Reading and Writing data into CSV ...
👉 Part 7 Reading and Writing data into binary files in python
• #7 Reading and Writing Into Binary Fi...
Topics:
Basic Concept of Reading from files
File modes for reading data from text files
read mode (r)
read and write mode (r+)
Functions used for reading data from text files:
read( ) in python
readline( ) in python
readlines( ) in python
Applications of read( ):
python program to read first 7 bytes from a file
python program to read first 3 bytes from a file and then another 5 bytes from the last read position
python program to read entire content from a file
python program to display the size of a file in bytes
Applications of readline( ):
python program to read the first 2 lines from a file
python program to read a complete file line by line
Applications of readlines( ):
python program to read the first 2 lines from a file
python program to read and display the last line from a file
python program to count the number of lines from a file
While implementing the practical programs in Python , I have used Spder IDE and textedit text editor , you can use any IDE and text editor of your choice.
Connect on these social media Handles:
👉 Instagram: / bhargab_kakati
👉 LinkedIn : / bhargabkakati
👉 Twitter : / bhargab008
Bhargab Kakati
PGT(Computer Science)
data file handling in python class 12
#Python #FileHandling #Class12 #ComputerScience #TextFiles #ReadingTextDataFromFiles