with open python print file name

Solutions on MaxInterview for with open python print file name by the best coders in the world

showing results for - "with open python print file name"
Federica
02 Sep 2018
1>>> f = open('/tmp/generic.png','r')
2>>> f.name
3'/tmp/generic.png'
4>>> import os
5>>> os.path.basename(f.name)
6'generic.png'
7