What is exactly a file-like object in Python?

后端 未结 4 1765
说谎
说谎 2020-12-31 03:15

In http://docs.python.org/library/json.html:

simplejson.load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, object_

4条回答
  •  半阙折子戏
    2020-12-31 03:28

    File-like objects are mainly StringIO objects, connected sockets and, well, actual file objects.

    If everything goes well, urllib.urlopen() returns a file-like object supporting the necessary methods.

提交回复
热议问题