Goku Coding Experience
Wednesday, 3 June 2020
How to get the file base name from a path using python?
>>>
import
os
>>>
base
=
os
.
path
.
basename
(
'/root/dir/sub/file.ext'
)
>>>
base
'file.ext'
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment