Bca-1a-30 ( File Handling in Python )
Bca-1a-30 ( File Handling in Python )
Xavier’s College
of Management & Technology
NAAC Accredited with B++ Grade (1st Cycle)
Digha – Aashiyana Road, Patna-800011, Bihar
subject – python
Topic – file handling in python
Name – Ajay Singh
Roll no – BCA2024030
Department – computer science
Under the guidance of: Dr. Supriya Shree
1
Table of contents
3
File handling operations
• Opening a file
• Reading to a file
• Writing to a file
• Appending a file
• Closing a file
4
Opening a file
• To perform any file operation, the first step is to open the file.
5
Various modes of opening a file
• There are various file opening modes in python. such as
6
Codes & Output
7
Types of file in python
8
Advantages
9
Disadvantages
• Security risks : File handling in Python can also pose security risks,
especially if the program accepts user input that can be used to access or
modify sensitive files on the system.
10
References
• https://www.geeksforgeeks.org (accessed on dated
28/11/2024)
• https://www.javatpoint.com (accessed on dated 28/11/2024)
• https://www.w3schools.com (accessed on dated 05/11/2024 )
11
ANY ?
QUESTI N
12
THANK
YOU !
13