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...
-
LIVE
Ouhel
4 hours agoSUNDAY | Active Matter | Exploring the postapocalyptic | O'HELL LIVE
78 watching -
LIVE
Astral Doge Plays!
5 hours agoFinal Fantasy IX ~LIVE!~ Iifa Tree Visitation Hours
35 watching -
LIVE
J0hnThunder
4 hours ago[Classic] Pac-Man World Re-Pac 1 and 2 👻 🟡 🟡 🟡 Relaxing on Sunday
140 watching -
LIVE
Lofi Girl
2 years agoSynthwave Radio 🌌 - beats to chill/game to
188 watching -
4:23:27
TonYGaMinG
7 hours agoâš” Trying out this NEW game called " SWORN " âš”
43.5K4 -
29:27
James Klüg
1 day agoAmericans Remembering Charlie Kirk
41.9K8 -
9:36:11
GoA_Malgus
13 hours ago $1.05 earnedGoA Malgus - The Legend Has Returned!!! - Live domination on Black Ops 6
29.5K2 -
48:15
SouthernbelleReacts
1 day ago $10.73 earnedWeapons (2025) REACTION | Josh Brolin, Julia Garner, Alden Ehrenreich | Horror-Mystery Thriller
68.7K34 -
39:36
mizery
4 days ago $1.47 earnedI Mastered Fortnite in 30 Days
43.2K7 -
25:50
ChopstickTravel
18 days ago $5.28 earned24 Hours With Sri Lanka’s Vedda People!! (Barehand Honey Harvest)
58.5K13