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
Caleb Hammer
2 hours agoThe First LGBT Divorce On Financial Audit
115 watching -
LIVE
Badlands Media
1 hour agoBadlands Daily: September 3, 2025 (#2)
3,319 watching -
LIVE
Jim Jordan
1 hour agoEurope’s Threat to American Speech and Innovation
494 watching -
LIVE
The State of Freedom
5 hours agoFLF: #16 Delivering the Truth Comes at a Cost w/ Joe Hoft
16 watching -
31:01
Rethinking the Dollar
1 hour agoWe're In A NEW Monetary Reality! Xi & Putin Knows How This ENDS | Morning Check-In: Let's Talk...
5.97K -
LIVE
House Committee on Energy and Commerce
2 hours agoExamining Opportunities to Advance American Health Care through the Use of AI Technologies
18 watching -
1:04:12
Crypto Power Hour
3 hours ago $0.19 earnedSmart Contracts & Fintech 101
4.94K5 -
45:55
Randi Hipper
1 hour agoBITCOIN HOLDS CRITICAL LEVEL! NEXT MOVE DETERMINES EVERYTHING
5.38K -
3:10:58
The Pete Santilli Show
12 hours agoMORNING STREAM Wednesday September 3, 2025 ▐ THE PETE SANTILLI SHOW & SANTILLI REPORT 9/2
9.7K1 -
1:41:59
Dear America
3 hours agoNational Guard To Chicago!!! 33k Epstein Files Released!! + Did Trump Threaten China?!
98.9K65