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
Putther
3 hours ago $0.26 earned🔴LAZY SUNDAY BOUNTY HUNTING ON GTA !!
73 watching -
LIVE
BBQPenguin_
2 hours agoThis is one of the BEST FREE TO PLAY Games!
21 watching -
1:14:12
Sports Wars
5 hours agoMark Sanchez STABBED And Arrested, Bill Belichick DISASTER, MLB Playoffs, NFL Week 5
34K2 -
1:30:58
Lara Logan
2 days agoENEMY AT THE GATES: Trevor Loudon Unmasks the Sinister Alliance Working to Destroy America | Ep 38
41.4K71 -
LIVE
NeoX5
3 hours agoCastlevania: Dawn of Sorrow | Part 1 | First Playthrough | Rumble Gaming
31 watching -
LIVE
DoldrumDan
1 hour agoDAY 3 NEW LIFE - DEPTH 4 RANKED NIGHTREIGN
16 watching -
40:24
The Connect: With Johnny Mitchell
1 day ago $16.40 earnedInside The WORST Drug-Infested Slums Of Medellin, Colombia
50.2K24 -
5:11:54
ttvglamourx
5 hours ago $10.54 earnedSUSSY SUNDAY !DISCORD
34.1K7 -
4:12:00
TheItalianCEO
6 hours agoBest VIDEO GAMES on a Sunday
33.5K1 -
17:14
Mrgunsngear
23 hours ago $11.97 earnedDerya DY9 Review - The Best Budget Glock Clone?
45.7K12