Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

get name of a file in python

>>> f = open('/tmp/generic.png','r')
>>> f.name
'/tmp/generic.png'
>>> import os
>>> os.path.basename(f.name)
'generic.png'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #file #python
ADD COMMENT
Topic
Name
6+8 =