python中查看一个对象的方法

先输入python进入python环境
例如:
>>> import json
>>> help(json)
可以看到这样的结果:




Help on package json:

NAME
    json - A simple, fast, extensible JSON encoder and decoder

FILE
    /usr/lib64/python2.6/json/__init__.py

DESCRIPTION
    JSON (JavaScript Object Notation) <http://json.org> is a subset of
    JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
    interchange format.
    
    json exposes an API familiar to uses of the standard library
    marshal and pickle modules.
    
    Encoding basic Python object hierarchies::
    
        >>> import json
        >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
        '["foo", {"bar": ["baz", null, 1.0, 2]}]'
        >>> print json.dumps("\"foo\bar")
        "\"foo\bar"
        >>> print json.dumps(u'\u1234')
        "\u1234"
        >>> print json.dumps('\\')
        "\\"
        >>> print json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True)
        {"a": 0, "b": 0, "c": 0}
        >>> from StringIO import StringIO
        >>> io = StringIO()
        >>> json.dump(['streaming API'], io)
        >>> io.getvalue()
        '["streaming API"]'
    
    Compact encoding::
    
        >>> import json
        >>> json.dumps([1,2,3,{'4': 5, '6': 7}], sort_keys=True, separators=(',',':'))
        '[1,2,3,{"4":5,"6":7}]'

.............................

你可能感兴趣的:(python)