This document discusses file handling in Python. It begins by explaining that files allow permanent storage of data, unlike standard input/output which is volatile. It then covers opening files in different modes, reading files line-by-line or as a whole, and modifying the file pointer position using seek(). Key points include opening files returns a file object, reading can be done line-by-line with for loops or using read()/readlines(), and seek() allows changing the file pointer location.
The document discusses file handling in Python. It begins by explaining the need for file handling such as storing data permanently and accessing it faster. It then defines what a file is and explains the different types of files - text files and binary files. It discusses the three main steps for file handling in Python - opening the file, processing the file by performing read/write operations, and closing the file. It also describes various file opening modes, methods for reading and writing text files, and modifying or appending content to text files.
The document discusses file handling in Python. It begins by explaining the need for files, such as to store data permanently and access it faster. It then covers opening and closing files, different file modes, reading and writing text files, modifying files by replacing strings, and using file attributes and methods like seek, tell, readlines and writelines. The document provides examples to demonstrate basic text file operations in Python.
FILE HANDLING in python to understand basic operations.ssuser00ad4e
The document discusses file handling in Python. It describes how to open, read from, write to, and close files. The key points are:
- Files can be opened in read, write, append modes using the open() function, which returns a file object.
- Reading file data uses functions like read(), readline(), and readlines(). Write uses write() and writelines().
- Files must be closed using the close() method on the file object after reading or writing to release system resources.
- Text files store data as characters while binary files store exact data types. Mode 'w' overwrites, 'a' appends without overwriting existing data.
This document discusses file handling in Python. It begins by explaining that files allow permanent storage of data, unlike standard input/output which is volatile. It then covers opening files in different modes, reading and writing file contents using methods like read(), readline(), readlines(), seeking to different positions, and closing files. Examples are provided to illustrate reading temperature data from one file and writing converted values to another file. The document also discusses creating, deleting and renaming files and folders using OS module functions.
Files in Python can be used to read data from disk files into a Python program and write data from a Python program back to disk files. There are two main types of files: text files, which store data as characters, and binary files, which store data in the same format as memory. Common file operations in Python include opening, reading, writing, and closing files. The open() function is used to open a file and return a file object, and the close() method closes the file and releases it for other applications. The with statement provides a convenient way to ensure files are closed after use.
The document discusses files in Python. It describes that files allow storing data permanently on disk that can be accessed by Python programs. There are two main types of files - text files, which store data as characters, and binary files, which store data in the same format as memory. The document outlines various methods for opening, reading, writing, and closing files in Python. It also discusses file paths and different file access modes.
This document discusses file operations in Python. It defines what a file is and explains that files are used to permanently store data on storage devices like hard disks. It describes the basic file operations of opening, reading, writing, and closing files. It also discusses text and binary file types and how to rename, delete, and get attribute information about files in Python.
This document provides information on file handling and dictionaries in Python. It discusses file paths, opening and closing files, reading from and writing to files. It also covers creating, accessing, adding, updating and deleting elements in dictionaries. Finally, it discusses directory methods like getcwd(), chdir(), listdir(), mkdir(), rmdir() and rename() for working with directories in Python.
This document provides an overview of file handling in Python. It discusses different file types like text files, binary files, and CSV files. It explains how to open, read, write, close, and delete files using functions like open(), read(), write(), close(), and os.remove(). It also covers reading and writing specific parts of a file using readline(), readlines(), seek(), and tell(). The document demonstrates how to handle binary files using pickle for serialization and deserialization. Finally, it shows how the os module can be used for file operations and how the csv module facilitates reading and writing CSV files.
The document discusses data file handling in Python. It covers the basics of opening, reading from, and writing to both text and binary files.
The key points covered include: opening and closing files, different file access modes, reading methods like readline(), readlines(), and read(), writing methods like write() and writelines(), random access methods like seek() and tell(), pickling and unpickling using the pickle module, and the differences between text and binary files.
The document discusses file input/output in Python including:
1) Accessing keyboard input using input() and raw_input() functions;
2) Printing to the screen using the print() function;
3) Opening, reading, and writing to files using functions like open(), read(), write(), close();
4) Different file modes for reading, writing, appending text and binary files.
This document discusses files in Python. It begins by defining what a file is and explaining that files enable persistent storage on disk. It then covers opening, reading from, and writing to files in Python. The main types of files are text and binary, and common file operations are open, close, read, and write. It provides examples of opening files in different modes, reading files line by line or in full, and writing strings or lists of strings to files. It also discusses searching files and handling errors when opening files. In the end, it presents some exercises involving copying files, counting words in a file, and converting decimal to binary.
File handling and Dictionaries in pythonnitamhaske
This document provides an introduction to file handling and dictionaries in Python. It discusses what files are and how they are used to store large amounts of data outside of RAM. Files are organized in a tree structure with paths to identify locations. There are two main types of files - text files which store character data and binary files which can store any type of data. The document outlines various functions for working with files, including open() to create a file object, close() to finish with the file, and attributes of the file object like name and mode. It also covers accessing a file, reading/writing data, and different modes for opening files.
The document provides information about file handling in Python. It discusses the basic operations on files like opening, reading, writing and closing files. It explains text files and binary files, different file access modes, and methods to read and write data from/to files like readline(), readlines(), read(), write() and writelines(). It also covers random access methods like seek() and tell() as well as pickling and unpickling using the pickle module. Finally, it highlights the differences between text and binary files.
File Handling Topic for tech management you know na tho kyuon puch raha hai saleRohitKurdiya1
The document discusses various file handling methods in Python like open(), read(), write(), readline(),readlines() and close(). It explains that open() is used to open a file and return a file object. The different modes of open() like 'r', 'w', 'a' are used to read, write and append files. Methods like read() reads the entire file content, readline() reads one line, readlines() returns a list of lines. write() is used to write content to a file in 'w' or 'a' mode. close() closes the file after operations.
JIMS Vasant Kunj-II is one of the best BCA colleges in Delhi NCR. The Course content provided to BCA students are well updated and as per the Demand of the IT Industry. It helps to get Placements in Top IT Companies.
This Pdf includes the Details of File Handling in C. This comes in Unit IV.
Files in Python can be used to permanently store data on disk. There are two main types - text files and binary files. Text files can be opened in a text editor while binary files require specific software. To handle files in Python, they must be opened, have operations performed, and then closed. There are different modes for opening files - read, write, append. The open() function returns a file object that can be used to read, write, close the file using methods like read(), write(), close(). Care must be taken when writing to ensure old data isn't overwritten.
Strengthened Senior High School - Landas Tool Kit.pptxSteffMusniQuiballo
Landas Tool Kit is a very helpful guide in guiding the Senior High School students on their SHS academic journey. It will pave the way on what curriculum exits will they choose and fit in.
How to Create a Rainbow Man Effect in Odoo 18Celine George
In Odoo 18, the Rainbow Man animation adds a playful and motivating touch to task completion. This cheerful effect appears after specific user actions, like marking a CRM opportunity as won. It’s designed to enhance user experience by making routine tasks more engaging.
More Related Content
Similar to this is about file concepts in class 12 in python , text file, binary file, csv file (20)
Files in Python can be used to read data from disk files into a Python program and write data from a Python program back to disk files. There are two main types of files: text files, which store data as characters, and binary files, which store data in the same format as memory. Common file operations in Python include opening, reading, writing, and closing files. The open() function is used to open a file and return a file object, and the close() method closes the file and releases it for other applications. The with statement provides a convenient way to ensure files are closed after use.
The document discusses files in Python. It describes that files allow storing data permanently on disk that can be accessed by Python programs. There are two main types of files - text files, which store data as characters, and binary files, which store data in the same format as memory. The document outlines various methods for opening, reading, writing, and closing files in Python. It also discusses file paths and different file access modes.
This document discusses file operations in Python. It defines what a file is and explains that files are used to permanently store data on storage devices like hard disks. It describes the basic file operations of opening, reading, writing, and closing files. It also discusses text and binary file types and how to rename, delete, and get attribute information about files in Python.
This document provides information on file handling and dictionaries in Python. It discusses file paths, opening and closing files, reading from and writing to files. It also covers creating, accessing, adding, updating and deleting elements in dictionaries. Finally, it discusses directory methods like getcwd(), chdir(), listdir(), mkdir(), rmdir() and rename() for working with directories in Python.
This document provides an overview of file handling in Python. It discusses different file types like text files, binary files, and CSV files. It explains how to open, read, write, close, and delete files using functions like open(), read(), write(), close(), and os.remove(). It also covers reading and writing specific parts of a file using readline(), readlines(), seek(), and tell(). The document demonstrates how to handle binary files using pickle for serialization and deserialization. Finally, it shows how the os module can be used for file operations and how the csv module facilitates reading and writing CSV files.
The document discusses data file handling in Python. It covers the basics of opening, reading from, and writing to both text and binary files.
The key points covered include: opening and closing files, different file access modes, reading methods like readline(), readlines(), and read(), writing methods like write() and writelines(), random access methods like seek() and tell(), pickling and unpickling using the pickle module, and the differences between text and binary files.
The document discusses file input/output in Python including:
1) Accessing keyboard input using input() and raw_input() functions;
2) Printing to the screen using the print() function;
3) Opening, reading, and writing to files using functions like open(), read(), write(), close();
4) Different file modes for reading, writing, appending text and binary files.
This document discusses files in Python. It begins by defining what a file is and explaining that files enable persistent storage on disk. It then covers opening, reading from, and writing to files in Python. The main types of files are text and binary, and common file operations are open, close, read, and write. It provides examples of opening files in different modes, reading files line by line or in full, and writing strings or lists of strings to files. It also discusses searching files and handling errors when opening files. In the end, it presents some exercises involving copying files, counting words in a file, and converting decimal to binary.
File handling and Dictionaries in pythonnitamhaske
This document provides an introduction to file handling and dictionaries in Python. It discusses what files are and how they are used to store large amounts of data outside of RAM. Files are organized in a tree structure with paths to identify locations. There are two main types of files - text files which store character data and binary files which can store any type of data. The document outlines various functions for working with files, including open() to create a file object, close() to finish with the file, and attributes of the file object like name and mode. It also covers accessing a file, reading/writing data, and different modes for opening files.
The document provides information about file handling in Python. It discusses the basic operations on files like opening, reading, writing and closing files. It explains text files and binary files, different file access modes, and methods to read and write data from/to files like readline(), readlines(), read(), write() and writelines(). It also covers random access methods like seek() and tell() as well as pickling and unpickling using the pickle module. Finally, it highlights the differences between text and binary files.
File Handling Topic for tech management you know na tho kyuon puch raha hai saleRohitKurdiya1
The document discusses various file handling methods in Python like open(), read(), write(), readline(),readlines() and close(). It explains that open() is used to open a file and return a file object. The different modes of open() like 'r', 'w', 'a' are used to read, write and append files. Methods like read() reads the entire file content, readline() reads one line, readlines() returns a list of lines. write() is used to write content to a file in 'w' or 'a' mode. close() closes the file after operations.
JIMS Vasant Kunj-II is one of the best BCA colleges in Delhi NCR. The Course content provided to BCA students are well updated and as per the Demand of the IT Industry. It helps to get Placements in Top IT Companies.
This Pdf includes the Details of File Handling in C. This comes in Unit IV.
Files in Python can be used to permanently store data on disk. There are two main types - text files and binary files. Text files can be opened in a text editor while binary files require specific software. To handle files in Python, they must be opened, have operations performed, and then closed. There are different modes for opening files - read, write, append. The open() function returns a file object that can be used to read, write, close the file using methods like read(), write(), close(). Care must be taken when writing to ensure old data isn't overwritten.
Strengthened Senior High School - Landas Tool Kit.pptxSteffMusniQuiballo
Landas Tool Kit is a very helpful guide in guiding the Senior High School students on their SHS academic journey. It will pave the way on what curriculum exits will they choose and fit in.
How to Create a Rainbow Man Effect in Odoo 18Celine George
In Odoo 18, the Rainbow Man animation adds a playful and motivating touch to task completion. This cheerful effect appears after specific user actions, like marking a CRM opportunity as won. It’s designed to enhance user experience by making routine tasks more engaging.
Exploring Ocean Floor Features for Middle SchoolMarie
This 16 slide science reader is all about ocean floor features. It was made to use with middle school students.
You can download the PDF at thehomeschooldaily.com
Thanks! Marie
Adam Grant: Transforming Work Culture Through Organizational PsychologyPrachi Shah
This presentation explores the groundbreaking work of Adam Grant, renowned organizational psychologist and bestselling author. It highlights his key theories on giving, motivation, leadership, and workplace dynamics that have revolutionized how organizations think about productivity, collaboration, and employee well-being. Ideal for students, HR professionals, and leadership enthusiasts, this deck includes insights from his major works like Give and Take, Originals, and Think Again, along with interactive elements for enhanced engagement.
Pests of Rice: Damage, Identification, Life history, and Management.pptxArshad Shaikh
Rice pests can significantly impact crop yield and quality. Major pests include the brown plant hopper (Nilaparvata lugens), which transmits viruses like rice ragged stunt and grassy stunt; the yellow stem borer (Scirpophaga incertulas), whose larvae bore into stems causing deadhearts and whiteheads; and leaf folders (Cnaphalocrocis medinalis), which feed on leaves reducing photosynthetic area. Other pests include rice weevils (Sitophilus oryzae) and gall midges (Orseolia oryzae). Effective management strategies are crucial to minimize losses.
Parenting Teens: Supporting Trust, resilience and independencePooky Knightsmith
For more information about my speaking and training work, visit: https://www.pookyknightsmith.com/speaking/
SESSION OVERVIEW:
Parenting Teens: Supporting Trust, Resilience & Independence
The teenage years bring new challenges—for teens and for you. In this practical session, we’ll explore how to support your teen through emotional ups and downs, growing independence, and the pressures of school and social life.
You’ll gain insights into the teenage brain and why boundary-pushing is part of healthy development, along with tools to keep communication open, build trust, and support emotional resilience. Expect honest ideas, relatable examples, and space to connect with other parents.
By the end of this session, you will:
• Understand how teenage brain development affects behaviour and emotions
• Learn ways to keep communication open and supportive
• Explore tools to help your teen manage stress and bounce back from setbacks
• Reflect on how to encourage independence while staying connected
• Discover simple strategies to support emotional wellbeing
• Share experiences and ideas with other parents
How to Manage Maintenance Request in Odoo 18Celine George
Efficient maintenance management is crucial for keeping equipment and work centers running smoothly in any business. Odoo 18 provides a Maintenance module that helps track, schedule, and manage maintenance requests efficiently.
Ray Dalio How Countries go Broke the Big CycleDadang Solihin
A complete and practical understanding of the Big Debt Cycle. A much more practical understanding of how supply and demand really work compared to the conventional economic thinking. A complete and practical understanding of the Overall Big Cycle, which is driven by the Big Debt Cycle and the other major cycles, including the big political cycle within countries that changes political orders and the big geopolitical cycle that changes world orders.
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...parmarjuli1412
The document provides an overview of therapeutic communication, emphasizing its importance in nursing to address patient needs and establish effective relationships. THERAPEUTIC COMMUNICATION included some topics like introduction of COMMUNICATION, definition, types, process of communication, definition therapeutic communication, goal, techniques of therapeutic communication, non-therapeutic communication, few ways to improved therapeutic communication, characteristics of therapeutic communication, barrier of THERAPEUTIC RELATIONSHIP, introduction of interpersonal relationship, types of IPR, elements/ dynamics of IPR, introduction of therapeutic nurse patient relationship, definition, purpose, elements/characteristics , and phases of therapeutic communication, definition of Johari window, uses, what actually model represent and its areas, THERAPEUTIC IMPASSES and its management in 5th semester Bsc. nursing and 2nd GNM students
HOW YOU DOIN'?
Cool, cool, cool...
Because that's what she said after THE QUIZ CLUB OF PSGCAS' TV SHOW quiz.
Grab your popcorn and be seated.
QM: THARUN S A
BCom Accounting and Finance (2023-26)
THE QUIZ CLUB OF PSGCAS.
Unit- 4 Biostatistics & Research Methodology.pdfKRUTIKA CHANNE
Blocking and confounding (when a third variable, or confounder, influences both the exposure and the outcome) system for Two-level factorials (a type of experimental design where each factor (independent variable) is investigated at only two levels, typically denoted as "high" and "low" or "+1" and "-1")
Regression modeling (statistical model that estimates the relationship between one dependent variable and one or more independent variables using a line): Hypothesis testing in Simple and Multiple regression models
Introduction to Practical components of Industrial and Clinical Trials Problems: Statistical Analysis Using Excel, SPSS, MINITAB®️, DESIGN OF EXPERIMENTS, R - Online Statistical Software to Industrial and Clinical trial approach
*Order Hemiptera:*
Hemiptera, commonly known as true bugs, is a large and diverse order of insects that includes cicadas, aphids, leafhoppers, and shield bugs. Characterized by their piercing-sucking mouthparts, Hemiptera feed on plant sap, other insects, or small animals. Many species are significant pests, while others are beneficial predators.
*Order Neuroptera:*
Neuroptera, also known as net-winged insects, is an order of insects that includes lacewings, antlions, and owlflies. Characterized by their delicate, net-like wing venation and large, often prominent eyes, Neuroptera are predators that feed on other insects, playing an important role in biological control. Many species have aquatic larvae, adding to their ecological diversity.
2. File Handling
A file is a sequence of bytes on
the disk/permanent storage
where a group of related data is
stored.
File is created for permanent
storage of data.
3. File Handling
Types of File
There are two types of files:
Text Files- A file whose contents can be viewed using a text editor is
called a text
file. (.txt)
• A text file is simply a sequence of ASCII or Unicode characters.
• EOL (new line character i.e. enter) or internal translation occurs
• e.g. Python programs, contents written in text editors
Binary Files-(.dat)
• A binary file stores the data in the same way as as stored in the memory.
• No EOL or internal translation occurs( not converted into other form
becoz it is converted into computer understandable form i.e. in binary
format)
• Best way to store program information.
. e.g. exe files,mp3 file, image files, word documents
we can’t read a binary file using a text editor.
4. TEXT FILE
•Text files don’t have any specific encoding
and it can be opened in
normal text editor itself.
•Example:
•Documents: txt, RTF etc.
•Tabular data: csv, tsv etc.
5. BINARY FILE
• Non human readable
• Can open in normal text editor.
• but we can’t read the content present inside the file.
• That’s because all the binary files will be encoded in the
binary format, which can be understood only by a computer or
machine.
• For handling such binary files we need a specific type of
software to open it.
• For Example, We need Microsoft word software to open .doc
binary files.
• Likewise, you need a pdf reader software to open .pdf binary
files and you need a photo editor software to read the
image files and so on.
6. File Handling
File operations- adding, modifying, deleting, reading, writing,
appending data There are three steps to perform these operations:
Open the file.- Before any reading or writing operation of any
file , it
must be opened first
of all.
Process file- i.e perform read or write operation.
Close the file.-Once we are done working with the file, we should
close the
file. Closing a file releases valuable system resources.
In case we forgot to close the file, Python automatically close the file
when
program ends or file object is no longer referenced in the
program.
However, if our program is large and we are reading or writing multiple files
that can take significant amount of resource on the system. If we keep
opening
new files carelessly, we could run out of resources.
7. File Handling
open () - built in function
Syntax
file_object/file_handler = open(<file_name>, <access_mode>,< buffering>)
file_name = name of the file ,enclosed in double quotes.
access_mode= It is also called file mode. Determines the what
kind
of operations can be performed with file,like read,write etc.
If no mode is specified then the file will open in read mode.
8. File Handling
Opening file
F=open(“notes.txt”,”r”) #open a file in read mode and specified relative
path
F1=open(r“c:usershpnotes.txt”,”r”)
#open a file in read mode and specified absolute path(if file is stored in some other
folder/location
F1=open(“c:usershpnotes.txt”,”w”)
To specify absolute path of the file either use in
each subpath or use r before the path , then
python environment will consider it as a raw path
string nothing else
F1=open(r “c:usershpnotes.txt”,”r”)
This ‘r’ has no relation with file
mode
9. File Handling
File opening modes-
Sr.
No
Mode & Description
1 r - reading only.Sets file pointer at beginning of the file . This is the defaultmode.
2 rb – same as r mode but with binary file
3 r+ - both reading and writing. The file pointer placed at the beginning of the file.
4 rb+ - same as r+ mode but with binary file
5 w - writing only. Overwrites the file if the file exists. If not, creates a new file for writing.
6 wb – same as w mode but with binary file.
7 w+ - both writing and reading. Overwrites . If no file exist, creates a new file for R & W.
8 wb+ - same as w+ mode but with binary file.
9 a -for appending. Move file pointer at end of the file.Creates new file for writing,if not exist.
10 ab – same as a but with binary file.
11 a+ - for both appending and reading. Move file pointer at end. If the file does not exist, it
creates
a new file for reading and writing.
12 ab+ - same as a+ mode but with binary mode.
10. File Handling
The read() Method
It reads the entire file and returnsit contents
in the form of a string.
Reads at most size bytes or less if end of
file occurs.
if size not mentioned then read the entire file
contents.
f=open(“notes.txt”,”r
”) r=f.read()
print(r)
11. File Handling
Read characters from last
position
read([size]) method
It reads the no of bytes
f=open(“notes.txt”,”r
”) r=f.read(10)
print(r)
r1=f.read(15
) print(r1)
12. File Handling
Absolute Path
The absolute path is the full path to some place on your computer.
OR
It is the path mentioned from the top level of hierarchy.
OR
To access a given file or directory, starting from the root of the file system
For example: Absolute path: C:UsershpDesktopcsfunction.py
Path-
it is a sequence which gives us access to a file.
•
• It is an address or location
Relative Path
The relative path is the path to some file with respect to current working
directory
e.g. Relative path: “function.py”
or
“..function.py”
13. File Handling
The read() Method
It reads the characters.It returns the read
characters as string
f=open(“notes.txt”,”r
”) r=f.read()
print(r)
14. File Handling
The readline() Method
It reads the line.It returns the read lines as
string
f=open(“notes.txt”,”r
”) r=f.readline()
print(r)
15. File Handling
The readlines() Method
It reads the lines.It returns the read lines as
list
f=open(“notes.txt”,”r
”) r=f.readlines()
print(r)
16. File Handling
Read first 2 lines
It reads the lines.It returns the read lines as list
f=open(“notes.txt”,”r
”) r=f.readline()
print(r)
r1=f.readline(
) print(r1)
OR
readlines([si
ze]) method-
Read no of
lines from
file if size
is
mentioned
17. File Handling
The close() Method
close(): Used to close an open file..
f=open(“notes.txt”,”r”)
r=f.read()
print(r)
f.close()
• After using this method, an opened file will
be closed and a closed file cannot be read or
written any more.
18. File Handling
Program to display number of lines in a
file.
f=open(“c:usershp
notes.txt”,”r”)
r=f.readlines(
) d=len(r)
print(d)
f.close()
19. File Handling
write() and read() based program
f = open("a.txt", 'w')
line1 = 'Welcome to python'
f.write(line1)
line2="nRegularly visit pythonapsdk.blogspot.com"
f.write(line2)
f.close()
f = open("a.txt", 'r')
text = f.read()
print(text)
f.close()
OUTPUT
Welcome to
python
Regularly visit
pythonapsdk.blo
gspot.com
20. File Handling
Append content to a File
f = open("a.txt", 'w')
line = 'Welcome to
pythonapsdk.blogspot.com’
f.write(line)
f.close()
f = open("a.txt",
'a+') f.write("
nthanks") f.close()
f = open("a.txt",
'r') text = f.read()
print(text)
f.close()
A
P
P
E
N
D
C
O
D
E
21. File Handling
FLUSH()
It forces the writing of data on disc still pending in
buffer
f = open("a.txt", 'w')
line = 'Welcome to pythonapsdk.blogspot.com’
f.flush()
D=“class
xii”
f.write(D)
f.write(“sect
ion L”)
f.flush()
f.close()
22. File Handling
File Pointer
It tells the current position in the file
where writing or reading
will take place.(like a bookmark in a
book)
The tell() method of python tells us the current
position within the file,where as The seek(offset[,
from]) method changes the current file position. If
from is 0, the beginning of the file to seek. If it is set
to 1, the current position is used . If it is set to 2 then
the end of the file would be taken as seek
position. The offset argument indicates the number
of bytes to be moved.
23. f = open("a.txt", 'w')
line = 'Welcome to
pythonapsdk.blogspot.com' f.write(line)
f.close()
f = open("a.txt", 'rb+')
print(f.tell())
print(f.read(7)) # read seven characters
print(f.tell())
print(f.read())
print(f.tell())
f.seek(9,0) # moves to 9 position from
begining
print(f.read(5))
f.seek(4, 1) # moves to 4 position from
current location
print(f.read(5))
f.seek(-5, 2) # Go to the 5th byte before the
end print(f.read(5))
File handling