Premium Only Content
This video is only available to Rumble Premium subscribers. Subscribe to
enjoy exclusive content and ad-free viewing.

Python - How to get file name from file path
1 year ago
2
How to get file name from file path in python
To extract the file name from a file path in Python, you can use the os.path.basename function from the os module or the Path.name attribute from the pathlib module.
Here's how you can do it with both methods
Using os.path.basename function
import os
file_path = '/path/to/your/file.txt'
file_name = os.path.basename(file_path)
print(file_name)
Loading comments...
-
5:36:05
a12cat34dog
9 hours agoI'VE NEVER PLAYED THIS GAME :: The Elder Scrolls IV: Oblivion Remastered :: FIRST-TIME PLAYING {18+}
32.8K7 -
2:17:47
AlaskanBallistics
16 hours ago $12.66 earnedI Love this Gun Podcast #28
57.2K14 -
3:12:28
tacetmort3m
14 hours ago🔴 LIVE - THIS GAME IS VERY FUN NOW - NO MORE ROOM IN HELL 2
22.8K -
5:23:12
RalliedLIVE
12 hours ago $5.91 earnedWarzone Wins All Night w/ Ral
109K5 -
LIVE
RaikenNight
8 hours ago $0.56 earnedJumping on the Oblivion bandwagon!!
115 watching -
1:30:55
Glenn Greenwald
9 hours agoPentagon in Turmoil Over Iran Policy as Israel Pushes for War; Lee Fang on New NIH Censorship Policy Threatening Medical Researchers | SYSTEM UPDATE #441
126K95 -
53:01
Anthony Rogers
2 days agoEpisode 363
55.8K7 -
1:15:04
Adam Does Movies
15 hours ago $0.86 earnedTalking Movie News + Blu-ray Giveaway + AMA - LIVE!
28K -
55:31
BIG NEM
7 hours agoCharlotte Dobre & Mike Ricci on Going VIRAL, Making Money & Leaving the 9-5 Grind
24.9K1 -
1:01:57
BonginoReport
11 hours agoTampon Tim’s Daughter: “Trump Would Have Deported Jesus” - Nightly Scroll w/ Hayley Caronia (Ep.31)
121K154