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...
-
2:25:31
vivafrei
21 hours agoEp. 281: Charlie Kirk; Routh Trial; Charlotte Train; Bolsanaro Defense; SCOTUS & MORE!
163K244 -
2:55:38
Turning Point USA
12 hours agoWASHINGTON D.C. PRAYER VIGIL FOR CHARLIE KIRK
102K44 -
35:54
The Mel K Show
12 hours agoMel K & Tim James | Healing is an Inside Job | 9-14-25
81.1K4 -
3:06:33
IsaiahLCarter
15 hours ago $15.93 earnedCharlie Kirk, American Martyr (with Mikale Olson) || APOSTATE RADIO 028
84.9K30 -
16:43
Mrgunsngear
19 hours ago $13.33 earnedKimber 2K11 Pro Review 🇺🇸
65.3K14 -
13:40
Michael Button
1 day ago $4.08 earnedThe Strangest Theory of Human Evolution
56.8K31 -
10:19
Blackstone Griddles
1 day agoMahi-Mahi Fish Tacos on the Blackstone Griddle
39.8K3 -
23:51
Jasmin Laine
1 day ago“Stop Wasting My Time!”—Trump's BRUTAL WARNING To Canada As Poilievre ROASTS CBC LIVE
30.3K30 -
9:54
Millionaire Mentor
1 day agoNBC Host EXPOSES JB Pritzker For Saying This About Trump
19.2K14 -
1:35:39
SB Mowing
2 days agoIt took the WHOLE NEIGHBORHOOD to uncover this yards SHOCKING SECRET
102K66