Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • DSA
  • Practice Problems
  • Python
  • C
  • C++
  • Java
  • Courses
  • Machine Learning
  • DevOps
  • Web Development
  • System Design
  • Aptitude
  • Projects
Similar Topics
Python
20.2k+ articles
Python Programs
4.1k+ articles
python-utility
660+ articles
python-os-module
210+ articles
python-file-handling
110+ articles
Python-sort
54 articles
Python OS-path-module
32 articles
Python os-module-programs
28 articles
Python DSA-exercises
27 articles
Python OS-file-module
2 articles

Python file-handling-programs

82 posts
How to read multiple text files from folder in Python?
Last Updated: 02 February 2021
Prerequisite:File HandlingosPython is a strong language which is extremely capable even when it comes to file handling. In this article, we ...read more
Python
Picked
Python file-handling-programs
Python - How to search for a string in text files?
Last Updated: 14 March 2023
In this article, we are going to see how to search for a string in text files using PythonExample:string = "GEEK FOR GEEKS"Input: "FOR" Out ...read more
Python
Picked
python-file-handling
Python file-handling-programs
How to iterate over files in directory using Python?
Last Updated: 24 February 2025
Iterating over files in a directory using Python involves accessing and processing files within a specified folder. Python provides multiple...read more
image
Python
Picked
Python file-handling-programs
Similar Topics
Python
20.2k+ articles
Python Programs
4.1k+ articles
python-utility
660+ articles
python-os-module
210+ articles
python-file-handling
110+ articles
Python-sort
54+ articles
Python OS-path-module
32+ articles
Python os-module-programs
28+ articles
Python DSA-exercises
27+ articles
Python OS-file-module
2+ articles
Write a dictionary to a file in Python
Last Updated: 01 April 2025
A dictionary store data using key-value pairs. Our task is that we need to save a dictionary to a file so that we can use it later, even aft...read more
image
Python
Picked
python-file-handling
Python file-handling-programs
How to read specific lines from a File in Python?
Last Updated: 21 March 2024
Text files are composed of plain text content. Text files are also known as flat files or plain files. Python provides easy support to read ...read more
image
Python
python-file-handling
Python file-handling-programs
How to get file size in Python?
Last Updated: 21 January 2021
We can follow different approaches to get the file size in Python. It's important to get the file size in Python to monitor file size or in ...read more
Python
python-file-handling
Python file-handling-programs
How to get file extension in Python?
Last Updated: 19 September 2023
In this article, we will cover How to extract file extensions using Python. How to Get File Extension in Python? Get File Extension in Pytho ...read more
Python
python-file-handling
Python OS-path-module
Python file-handling-programs
Count number of lines in a text file in Python
Last Updated: 25 April 2025
Counting the number of characters is important because almost all the text boxes that rely on user input have a certain limit on the number ...read more
image
Python
python-file-handling
Python file-handling-programs
Python program to read file word by word
Last Updated: 06 September 2024
Python is a great language for file handling, and it provides built-in functions to make reading files easy with which we can read file word...read more
image
Python
Python Programs
python-file-handling
Python file-handling-programs
Get parent of current directory using Python
Last Updated: 13 October 2022
In Python, OS module is used to interact with the operating system. It comes under Python's standard utility modules. This module provides a...read more
image
Python
python-file-handling
Python OS-path-module
Python file-handling-programs
Python os-module-programs
Get Current directory in Python
Last Updated: 03 February 2024
In this article, we will cover How to Get and Change the Working Directory in Python. While working with file handling you might have notice...read more
image
Python
python-file-handling
python-os-module
Python file-handling-programs
Python os-module-programs
Check if a File or Directory Exists in Python
Last Updated: 04 January 2025
To check how to check if a Directory Exists without exceptions in Pythonwe have the following ways to check whether a file or directory alre ...read more
Python
python-file-handling
Python OS-path-module
Python file-handling-programs
Delete a directory or file using Python
Last Updated: 26 November 2024
In this article, we will cover how to delete (remove) files and directories in Python. Python provides different methods and functions for r...read more
image
Python
Python Programs
python-file-handling
Python OS-path-module
Python file-handling-programs
Python - How to Check if a file or directory exists
Last Updated: 24 April 2024
Sometimes it's necessary to verify whether a dictionary or file exists. This is because you might want to make sure the file is available be ...read more
Python
python-file-handling
Python OS-path-module
Python file-handling-programs
Create a directory in Python
Last Updated: 08 October 2024
In Python, you can create directories to store and manage your data efficiently. This capability is particularly useful when building applic ...read more
Python
python-file-handling
python-os-module
Python file-handling-programs
Python os-module-programs
1 2 3 4 5 6 >>
Last
1 2 3 4 5 6 >>
Last
1 2 3 4 >>
Last
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox