Answers for "<type 'file'> python3"

0

<type 'file'> 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
Posted by: Guest on March-31-2021

Code answers related to "<type 'file'> python3"

Python Answers by Framework

Browse Popular Code Answers by Language