
1 no1xsyzy 2018 年 11 月 19 日 https://docs.python.org/2/library/types.html?highlight=types%20filetype#types.FileType > types.FileType > The type of open file objects such as sys.stdout; alias of the built-in file. >>> type(sys.stdout) <class '_io.TextIOWrapper'> |
2 warcraft1236 2018 年 11 月 19 日 查了一下,pip install filetype 还是有的,而且文档中给了用法 |
3 chenstack 2018 年 11 月 19 日 试了一下,可以用 io.IOBase 判断 from io import IOBase isinstance(r, IOBase) |
4 acone2003 OP 谢谢 chenstack,OK!同时也谢谢楼上两位! |