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...
-
18:31
Clownfish TV
23 hours agoJimmy Kimmel Ratings DROP 71%! BlueSky ATTACKS Jimmy Fallon for Staying Apolitical! | Clownfish TV
1.05K7 -
26:11
Midwest Crime
7 hours agoSenator-Turned-Burglar Didn't Want This Video Released
13 -
LIVE
Matt Kohrs
10 hours agoPAYDAY FRIDAY!!! || Live Trading Futures & Options
578 watching -
LIVE
Wendy Bell Radio
5 hours agoBig Tish And The Big House
7,327 watching -
LIVE
Total Horse Channel
1 hour agoLow Roller Reining Classic | Main Arena | October 10th, 2025
22 watching -
1:03:22
Chad Prather
14 hours agoPalm Branch Politics: When the Kingdom Confronts the Empire
33.5K26 -
LIVE
LFA TV
11 hours agoLIVE & BREAKING NEWS! | FRIDAY 10/10/25
2,735 watching -
1:05:42
Crypto Power Hour
2 hours ago $0.04 earnedGold Tokenization w/ Sebastian Serrell-Watts COO Solum Global
2.98K9 -
2:10:54
Game On!
20 hours ago $3.82 earnedHappy Football Friday! Best Bets For The Weekend!
34.7K1 -
8:20
Freedom Frontline
18 hours agoChuck Schumer PANICS As Republican Senator EXPOSES His Double Standards
31.1K30