Detecing data types in Python
本问题已经有最佳答案,请猛点这里访问。
我是Python的新手,我不确定数据类型。如果我编码
它是一个
1 2 3 4 5 | >>> wordfile = open('file.txt', 'w') >>> wordfile <_io.TextIOWrapper name='file.txt' mode='w' encoding='cp1255'> >>> type(wordfile) <class '_io.TextIOWrapper'> |
官方文件声称:
class io.TextIOWrapper
A buffered text stream over a
BufferedIOBase
binary stream.
是指,
class io.BufferedIOBase
Base class for binary streams that support some kind of buffering.