filmov
tv
Pathlib Module In Python - How To Effectively Use Path Class Of Pathlib Module

Показать описание
Pathlib module was introduced in Python 3.4 with PEP 428. It is a part of the Python standard library that provides an object-oriented interface for working with file paths. It allows us to create, manipulate, and operate on file paths in a platform-agnostic way.
Before the introduction to this module in Python, the obvious module to work with files was the OS module, which by the way is still very handy for many useful tasks. But for working with files OS module manipulates the path of the file as pure strings. Whereas the Pathlib module takes an object-oriented approach.
OS Module Tutorial:
This is an excellent tutorial to learn:
00:24 - Introduction
00:48 - What is the use of Pathlib
02:18 - List of all methods used with the Path class of pathlib module
02:55 - Manipulating Directories paths
03:32 - Creating a new directory
04:08 - Join Paths
04:58 - Delete directory
05:28 - Manipulating files path
06:42 - Iterating over all files and dirs of a directory
08:55 - Getting metadata of files
12:38 - Reading and writing to the files
14:20 - Deleting a file
Python Projects Playlist:
Get all the codes at Github Repos:
Facebook:
Twitter:
StackOverflow
Before the introduction to this module in Python, the obvious module to work with files was the OS module, which by the way is still very handy for many useful tasks. But for working with files OS module manipulates the path of the file as pure strings. Whereas the Pathlib module takes an object-oriented approach.
OS Module Tutorial:
This is an excellent tutorial to learn:
00:24 - Introduction
00:48 - What is the use of Pathlib
02:18 - List of all methods used with the Path class of pathlib module
02:55 - Manipulating Directories paths
03:32 - Creating a new directory
04:08 - Join Paths
04:58 - Delete directory
05:28 - Manipulating files path
06:42 - Iterating over all files and dirs of a directory
08:55 - Getting metadata of files
12:38 - Reading and writing to the files
14:20 - Deleting a file
Python Projects Playlist:
Get all the codes at Github Repos:
Facebook:
Twitter:
StackOverflow
Комментарии