Skip to content
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
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Sign In
▲
Similar Topics
Python
20.5k+ articles
Python Programs
4k+ articles
python-utility
660+ articles
Programming Language
340+ articles
python-os-module
210+ articles
python-file-handling
110+ articles
Python file-handling-programs
82 articles
Python OS-path-module
32 articles
Python directory-program
26 articles
Python OS-file-module
2 articles
Python os-module-programs
28 posts
Popular Articles
Recent Articles
Python Program to Get the File Name From the File Path
Last Updated: 21 August 2024
In this article, we will be looking at the program to get the file name from the given file path in the Python programming language. Sometim
...read more
Python
Python Programs
Picked
python-os-module
Python directory-program
Python os-module-programs
How to get file creation and modification date or time in Python?
Last Updated: 15 March 2024
We often need to access various file properties for different purposes. Among the file properties, the creation and modification time of a f
...read more
Python
Picked
python-os-module
Python os-module-programs
Kill a Process by name using Python
Last Updated: 30 June 2021
A process is identified on the system by what is referred to as a process ID and no other process can use that number as its process ID whil
...read more
Python
python-utility
python-os-module
Python os-module-programs
Similar Topics
Python
20.5k+ articles
Python Programs
4k+ articles
python-utility
660+ articles
Programming Language
340+ articles
python-os-module
210+ articles
python-file-handling
110+ articles
Python file-handling-programs
82+ articles
Python OS-path-module
32+ articles
Python directory-program
26+ articles
Python OS-file-module
2+ articles
Python - Get list of running processes
Last Updated: 25 April 2025
A Process is a program that is being executed (processed). A process may not have to be one run explicitly by the user, it could be a system
...read more
Python
python-utility
python-os-module
Python os-module-programs
Get number of characters, words, spaces and lines in a file - Python
Last Updated: 24 February 2025
Given a text file fname, the task is to count the total number of characters, words, spaces, and lines in the file. As we know, Python provi
...read more
Python
Programming Language
Python Programs
python-file-handling
python-os-module
Python file-handling-programs
Write From Home
Python os-module-programs
Change current working directory with Python
Last Updated: 07 September 2021
The OS module in Python is used for interacting with the operating system. This module comes under Python's standard utility module so there
...read more
Python
python-file-handling
python-os-module
Python directory-program
Python os-module-programs
How to move Files and Directories in Python
Last Updated: 29 December 2020
Python provides functionality to move files or directories from one location to another location. This can be achieved using shutil.move() f
...read more
Python
python-file-handling
python-os-module
Python os-module-programs
Check if directory contains files using python
Last Updated: 12 December 2022
Finding if a directory is empty or not in Python can be achieved using the listdir() method of the os library. OS module in Python provides
...read more
Technical Scripter
Python
Picked
python-os-module
Technical Scripter 2019
Python os-module-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
Python
python-file-handling
Python OS-path-module
Python file-handling-programs
Python os-module-programs
Python: Check if a directory is empty
Last Updated: 29 December 2020
Python is a widely used general-purpose, high-level programming language. It provides many functionalities and one among them is checking wh
...read more
Python
python-file-handling
Python OS-file-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
Python
python-file-handling
python-os-module
Python file-handling-programs
Python os-module-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
How to get the permission mask of a file in Python
Last Updated: 23 January 2024
In UNIX-like operating systems, new files are created with a default set of permissions. We can restrict or provide any specific set of perm
...read more
Python
Python Programs
python-os-module
Python os-module-programs
Python | Move or Copy Files and Directories
Last Updated: 29 December 2020
Let's say we want to copy or move files and directories around, but don’t want to do it by calling out to shell commands. The shutil modul
...read more
Python
python-file-handling
python-os-module
Python file-handling-programs
Python os-module-programs
Rename all file names in your directory using Python
Last Updated: 15 August 2021
Given multiple files in a directory having different names, the task is to rename all those files in sorted order. We can use OS module in
...read more
Python
Python Programs
python-os-module
Python OS-file-module
Python os-module-programs
1
2
>>
Last
1
2
>>
Last
1
2
>>
Last
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
Got It !