adplus-dvertising
frame-decoration

Question

How do you get the name of a file from a file object (fp)?

a.

fp.name

b.

fp.file(name)

c.

self.__name__(fp)

d.

fp.__name__()

Posted under Python

Answer: (a).fp.name

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. How do you get the name of a file from a file object (fp)?