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

Publié le: 09 janvier 2023
sur la chaîne: Aparsoft AI
1,175
51

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:
   • Python OS Module Tutorial | OS Module | In...  


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:
   • Python Projects For Beginners  

Get all the codes at Github Repos:
https://github.com/CodingMantras?tab=...

Facebook:
Coding Mantras(Cod-Man):   / codingmantras22  

Twitter:
RS Punia:   / codingmantras  

StackOverflow
https://stackoverflow.com/users/14476...


Sur cette page du site, vous pouvez voir la vidéo en ligne Pathlib Module In Python - How To Effectively Use Path Class Of Pathlib Module durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Aparsoft AI 09 janvier 2023, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,175 fois et il a aimé 51 téléspectateurs. Bon visionnage!