LESSON PLAN
Prepared by
[Link]
LESSON PLAN
Date :
Std :XII
Topic : File handling in python
Learning Outcomes:
The students will be able to understand the following concept,
Introduction about File Handling in python
Data files
Opening and closing Files
Working with Text files
Teaching methodology:
The teacher will motivate the students by asking few question for
example.,
What is Data File in Python?
The teachers will explain the topic one by one by showing the PPT with
real time example.
Python Data File:-
In Python, a "data file" refers to any file that is used to store information
which can be processed or manipulated by a Python program. These files can
contain data in various formats, including
Data files
Text files Binary files
Text Files:-Text files store data in plain text format. They can be easily
read by humans and can be edited with a simple text editor. Each line of text
is typically terminated by a newline character.
Use: Storing simple data, logs, configuration instructions, etc.
Text
Regular Delimited
Binary Files:-
Definition: Binary files contain data in a binary format, not readable by
humans without interpretation. They can store data more compactly than
text files and are often used for media (images, audio, video) or data that
requires specific encoding.
Use: Storing complex data such as images, executable files, database files, etc.
Using open() and close():-
The basic way to open a file in Python is by using the open() function, which
returns a file object. After you're done with the file, you should close it using
the close() method. This ensures that resources are freed up and changes are
written to the disk.
Aids: E-Tect Board , Power point Presentation.
Assignment:
1. What is the difference between a text file and a binary file?
2. What is the difference between read( ) and readlines ( ) function?
Reflective Log:
In order to find the knowledge of the students a few questions were asked
1. The two types of data files can be _____ and _______.
2. The default file open mode is_______mode
Signature of the staff :
Signature of the co ordinator:
Signature of the Principal :