Answers for "with open python print file name"

0

with open python print file name

>>> f = open('/tmp/generic.png','r')
>>> f.name
'/tmp/generic.png'
>>> import os
>>> os.path.basename(f.name)
'generic.png'
Posted by: Guest on December-06-2020

Python Answers by Framework

Browse Popular Code Answers by Language