type file python code example
Example: python3
# In python3, builtin file is no more present.
# In python3, file objects are part of the io module. You can do it something like this.
>>> from io import IOBase
>>> f = open(<filePath>, 'w')
>>> isinstance(f, IOBase)
True
>>> isinstance(object(), IOBase)
False