python中的pprint.pprint(),类似于print()

下面是我做的demo:

 #python pprint

 '''python API中提供的Sample'''
import json
import pprint
from urllib.request import urlopen with urlopen('http://pypi.python.org/pypi/configparser/json') as url:
http_info = url.info()
raw_data = url.read().decode(http_info.get_content_charset())
project_info = json.loads(raw_data)
result = {'headers' : http_info.items(), 'body' : project_info} pprint.pprint(result) pprint.pprint('#' * 50)
pprint.pprint(result, depth=3) pprint.pprint('#' * 50)
pprint.pprint(result['headers'], width=30) pprint.pprint('#' * 50)
#自定义Demo
test_list = ['a', 'c', 'e', 'd', '']
test_list.insert(0, test_list)
pprint.pprint(test_list)

运行效果:

Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
{'body': {'info': {'_pypi_hidden': False,
'_pypi_ordering': 14,
'author': 'Łukasz Langa',
'author_email': 'lukasz@langa.pl',
'bugtrack_url': None,
'cheesecake_code_kwalitee_id': None,
'cheesecake_documentation_id': None,
'cheesecake_installability_id': None,
'classifiers': ['Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules'],
'description': '============\nconfigparser\n============\n\nThe ancient ``ConfigParser`` module available in the standard library 2.x has\nseen a major update in Python 3.2. This is a backport of those changes so that\nthey can be used directly in Python 2.6 - 2.7.\n\nTo use ``configparser`` instead of ``ConfigParser``, simply replace::\n \n import ConfigParser\n\nwith::\n\n import configparser\n\nFor detailed documentation consult the vanilla version at\nhttp://docs.python.org/3/library/configparser.html.\n\nWhy you\'ll love ``configparser``\n--------------------------------\n\nWhereas almost completely compatible with its older brother, ``configparser``\nsports a bunch of interesting new features:\n\n* full mapping protocol access (`more info\n <http://docs.python.org/3/library/configparser.html#mapping-protocol-access>`_)::\n\n >>> parser = ConfigParser()\n >>> parser.read_string("""\n [DEFAULT]\n location = upper left\n visible = yes\n editable = no\n color = blue\n\n [main]\n title = Main Menu\n color = green\n\n [options]\n title = Options\n """)\n >>> parser[\'main\'][\'color\']\n \'green\'\n >>> parser[\'main\'][\'editable\']\n \'no\'\n >>> section = parser[\'options\']\n >>> section[\'title\']\n \'Options\'\n >>> section[\'title\'] = \'Options (editable: %(editable)s)\'\n >>> section[\'title\']\n \'Options (editable: no)\'\n \n* there\'s now one default ``ConfigParser`` class, which basically is the old\n ``SafeConfigParser`` with a bunch of tweaks which make it more predictable for\n users. Don\'t need interpolation? Simply use\n ``ConfigParser(interpolation=None)``, no need to use a distinct\n ``RawConfigParser`` anymore.\n\n* the parser is highly `customizable upon instantiation\n <http://docs.python.org/3/library/configparser.html#customizing-parser-behaviour>`__\n supporting things like changing option delimiters, comment characters, the\n name of the DEFAULT section, the interpolation syntax, etc.\n\n* you can easily create your own interpolation syntax but there are two powerful\n implementations built-in (`more info\n <http://docs.python.org/3/library/configparser.html#interpolation-of-values>`__):\n\n * the classic ``%(string-like)s`` syntax (called ``BasicInterpolation``)\n\n * a new ``${buildout:like}`` syntax (called ``ExtendedInterpolation``)\n \n* fallback values may be specified in getters (`more info\n <http://docs.python.org/3/library/configparser.html#fallback-values>`__)::\n\n >>> config.get(\'closet\', \'monster\',\n ... fallback=\'No such things as monsters\')\n \'No such things as monsters\'\n \n* ``ConfigParser`` objects can now read data directly `from strings\n <http://docs.python.org/3/library/configparser.html#configparser.ConfigParser.read_string>`__\n and `from dictionaries\n <http://docs.python.org/3/library/configparser.html#configparser.ConfigParser.read_dict>`__.\n That means importing configuration from JSON or specifying default values for\n the whole configuration (multiple sections) is now a single line of code. Same\n goes for copying data from another ``ConfigParser`` instance, thanks to its\n mapping protocol support. \n\n* many smaller tweaks, updates and fixes\n\nA few words about Unicode\n-------------------------\n\n``configparser`` comes from Python 3 and as such it works well with Unicode.\nThe library is generally cleaned up in terms of internal data storage and\nreading/writing files. There are a couple of incompatibilities with the old\n``ConfigParser`` due to that. However, the work required to migrate is well\nworth it as it shows the issues that would likely come up during migration of\nyour project to Python 3.\n\nThe design assumes that Unicode strings are used whenever possible [1]_. That\ngives you the certainty that what\'s stored in a configuration object is text.\nOnce your configuration is read, the rest of your application doesn\'t have to\ndeal with encoding issues. All you have is text [2]_. The only two phases when\nyou should explicitly state encoding is when you either read from an external\nsource (e.g. a file) or write back. \n\nVersioning\n----------\n\nThis backport is intended to keep 100% compatibility with the vanilla release in\nPython 3.2+. To help maintaining a version you want and expect, a versioning\nscheme is used where:\n\n* the first three numbers indicate the version of Python 3.x from which the\n backport is done\n\n* a backport release number is provided after the ``r`` letter\n\nFor example, ``3.3.0r1`` is the **first** release of ``configparser`` compatible\nwith the library found in Python **3.3.0**.\n\nA single exception from the 100% compatibility principle is that bugs fixed\nbefore releasing another minor Python 3.x.y version **will be included** in the\nbackport releases done in the mean time. This rule applies to bugs only.\n\nMaintenance\n-----------\n\nThis backport is maintained on BitBucket by Łukasz Langa, the current vanilla\n``configparser`` maintainer for CPython:\n\n* `configparser Mercurial repository <https://bitbucket.org/ambv/configparser>`_\n\n* `configparser issue tracker <https://bitbucket.org/ambv/configparser/issues>`_ \n\nChange Log\n----------\n\n3.3.0r2\n~~~~~~~\n\n* updated the fix for `#16820 <http://bugs.python.org/issue16820>`_: parsers\n now preserve section order when using ``__setitem__`` and ``update``\n\n3.3.0r1\n~~~~~~~\n\n* compatible with 3.3.0 + fixes for `#15803\n <http://bugs.python.org/issue15803>`_ and `#16820\n <http://bugs.python.org/issue16820>`_\n\n* fixes `BitBucket issue #4\n <https://bitbucket.org/ambv/configparser/issue/4>`_: ``read()`` properly\n treats a bytestring argument as a filename\n\n* `ordereddict <http://pypi.python.org/pypi/ordereddict>`_ dependency required\n only for Python 2.6\n\n* `unittest2 <http://pypi.python.org/pypi/unittest2>`_ explicit dependency\n dropped. If you want to test the release, add ``unittest2`` on your own.\n\n3.2.0r3\n~~~~~~~\n\n* proper Python 2.6 support\n\n * explicitly stated the dependency on `ordereddict\n <http://pypi.python.org/pypi/ordereddict>`_\n\n * numbered all formatting braces in strings\n\n* explicitly says that Python 2.5 support won\'t happen (too much work necessary\n without abstract base classes, string formatters, the ``io`` library, etc.)\n\n* some healthy advertising in the README\n\n3.2.0r2\n~~~~~~~\n\n* a backport-specific change: for convenience and basic compatibility with the\n old ConfigParser, bytestrings are now accepted as section names, options and\n values. Those strings are still converted to Unicode for internal storage so\n in any case when such conversion is not possible (using the \'ascii\' codec),\n UnicodeDecodeError is raised.\n\n3.2.0r1\n~~~~~~~\n\n* the first public release compatible with 3.2.0 + fixes for `#11324\n <http://bugs.python.org/issue11324>`_, `#11670\n <http://bugs.python.org/issue11670>`_ and `#11858\n <http://bugs.python.org/issue11858>`_.\n\nConversion Process\n------------------\n\nThis section is technical and should bother you only if you are wondering how\nthis backport is produced. If the implementation details of this backport are\nnot important for you, feel free to ignore the following content.\n\n``configparser`` is converted using `3to2 <http://pypi.python.org/pypi/3to2>`_.\nBecause a fully automatic conversion was not doable, I took the following\nbranching approach:\n\n* the ``3.x`` branch holds unchanged files synchronized from the upstream\n CPython repository. The synchronization is currently done by manually copying\n the required files and stating from which CPython changeset they come from.\n\n* the ``3.x-clean`` branch holds a version of the ``3.x`` code with some tweaks\n that make it independent from libraries and constructions unavailable on 2.x.\n Code on this branch still *must* work on the corresponding Python 3.x. You\n can check this running the supplied unit tests.\n\n* the ``default`` branch holds necessary changes which break unit tests on\n Python 3.2. Additional files which are used by the backport are also stored\n here.\n\nThe process works like this:\n\n1. I update the ``3.x`` branch with new versions of files. Commit.\n\n2. I merge the new commit to ``3.x-clean``. Check unit tests. Commit.\n\n3. If there are necessary changes that can be made in a 3.x compatible manner,\n I do them now (still on ``3.x-clean``), check unit tests and commit. If I\'m\n not yet aware of any, no problem.\n\n4. I merge the changes from ``3.x-clean`` to ``default``. Commit.\n\n5. If there are necessary changes that *cannot* be made in a 3.x compatible\n manner, I do them now (on ``default``). Note that the changes should still\n be written using 3.x syntax. If I\'m not yet aware of any required changes,\n no problem.\n\n6. I run ``./convert.py`` which is a custom ``3to2`` runner for this project.\n\n7. I run the unit tests with ``unittest2`` on Python 2.x. If the tests are OK,\n I can prepare a new release. Otherwise, I revert the ``default`` branch to\n its previous state (``hg revert .``) and go back to Step 3.\n\n**NOTE:** the ``default`` branch holds unconverted code. This is because keeping\nthe conversion step as the last (after any custom changes) helps managing the\nhistory better. Plus, the merges are nicer and updates of the converter software\ndon\'t create nasty conflicts in the repository.\n\nThis process works well but if you have any tips on how to make it simpler and\nfaster, do enlighten me :)\n\nFootnotes\n---------\n\n.. [1] To somewhat ease migration, passing bytestrings is still supported but\n they are converted to Unicode for internal storage anyway. This means\n that for the vast majority of strings used in configuration files, it\n won\'t matter if you pass them as bytestrings or Unicode. However, if you\n pass a bytestring that cannot be converted to Unicode using the naive\n ASCII codec, a ``UnicodeDecodeError`` will be raised. This is purposeful\n and helps you manage proper encoding for all content you store in\n memory, read from various sources and write back.\n\n.. [2] Life gets much easier when you understand that you basically manage\n **text** in your application. You don\'t care about bytes but about\n letters. In that regard the concept of content encoding is meaningless.\n The only time when you deal with raw bytes is when you write the data to\n a file. Then you have to specify how your text should be encoded. On\n the other end, to get meaningful text from a file, the application\n reading it has to know which encoding was used during its creation. But\n once the bytes are read and properly decoded, all you have is text. This\n is especially powerful when you start interacting with multiple data\n sources. Even if each of them uses a different encoding, inside your\n application data is held in abstract text form. You can program your\n business logic without worrying about which data came from which source.\n You can freely exchange the data you store between sources. Only\n reading/writing files requires encoding your text to bytes.',
'docs_url': '',
'download_url': 'UNKNOWN',
'home_page': 'http://docs.python.org/3/library/configparser.html',
'keywords': 'configparser ini parsing conf cfg configuration file',
'license': 'MIT',
'maintainer': None,
'maintainer_email': None,
'name': 'configparser',
'package_url': 'http://pypi.python.org/pypi/configparser',
'platform': 'any',
'release_url': 'http://pypi.python.org/pypi/configparser/3.3.0r2',
'requires_python': None,
'stable_version': None,
'summary': 'This library brings the updated configparser from Python 3.2+ to Python 2.6-2.7.',
'version': '3.3.0r2'},
'urls': [{'comment_text': '',
'downloads': 11937,
'filename': 'configparser-3.3.0r2.tar.gz',
'has_sig': False,
'md5_digest': 'dda0e6a43e9d8767b36d10f1e6770f09',
'packagetype': 'sdist',
'python_version': 'source',
'size': 32885,
'upload_time': '2013-01-02T00:58:20',
'url': 'https://pypi.python.org/packages/source/c/configparser/configparser-3.3.0r2.tar.gz'}]},
'headers': [('Date', 'Thu, 15 Aug 2013 06:17:52 GMT'),
('Content-Type', 'application/json; charset="UTF-8"'),
('Content-Disposition', 'inline'),
('Strict-Transport-Security', 'max-age=31536000'),
('Content-Length', ''),
('Accept-Ranges', 'bytes'),
('Age', ''),
('Connection', 'close')]}
'##################################################'
{'body': {'info': {'_pypi_hidden': False,
'_pypi_ordering': 14,
'author': 'Łukasz Langa',
'author_email': 'lukasz@langa.pl',
'bugtrack_url': None,
'cheesecake_code_kwalitee_id': None,
'cheesecake_documentation_id': None,
'cheesecake_installability_id': None,
'classifiers': [...],
'description': '============\nconfigparser\n============\n\nThe ancient ``ConfigParser`` module available in the standard library 2.x has\nseen a major update in Python 3.2. This is a backport of those changes so that\nthey can be used directly in Python 2.6 - 2.7.\n\nTo use ``configparser`` instead of ``ConfigParser``, simply replace::\n \n import ConfigParser\n\nwith::\n\n import configparser\n\nFor detailed documentation consult the vanilla version at\nhttp://docs.python.org/3/library/configparser.html.\n\nWhy you\'ll love ``configparser``\n--------------------------------\n\nWhereas almost completely compatible with its older brother, ``configparser``\nsports a bunch of interesting new features:\n\n* full mapping protocol access (`more info\n <http://docs.python.org/3/library/configparser.html#mapping-protocol-access>`_)::\n\n >>> parser = ConfigParser()\n >>> parser.read_string("""\n [DEFAULT]\n location = upper left\n visible = yes\n editable = no\n color = blue\n\n [main]\n title = Main Menu\n color = green\n\n [options]\n title = Options\n """)\n >>> parser[\'main\'][\'color\']\n \'green\'\n >>> parser[\'main\'][\'editable\']\n \'no\'\n >>> section = parser[\'options\']\n >>> section[\'title\']\n \'Options\'\n >>> section[\'title\'] = \'Options (editable: %(editable)s)\'\n >>> section[\'title\']\n \'Options (editable: no)\'\n \n* there\'s now one default ``ConfigParser`` class, which basically is the old\n ``SafeConfigParser`` with a bunch of tweaks which make it more predictable for\n users. Don\'t need interpolation? Simply use\n ``ConfigParser(interpolation=None)``, no need to use a distinct\n ``RawConfigParser`` anymore.\n\n* the parser is highly `customizable upon instantiation\n <http://docs.python.org/3/library/configparser.html#customizing-parser-behaviour>`__\n supporting things like changing option delimiters, comment characters, the\n name of the DEFAULT section, the interpolation syntax, etc.\n\n* you can easily create your own interpolation syntax but there are two powerful\n implementations built-in (`more info\n <http://docs.python.org/3/library/configparser.html#interpolation-of-values>`__):\n\n * the classic ``%(string-like)s`` syntax (called ``BasicInterpolation``)\n\n * a new ``${buildout:like}`` syntax (called ``ExtendedInterpolation``)\n \n* fallback values may be specified in getters (`more info\n <http://docs.python.org/3/library/configparser.html#fallback-values>`__)::\n\n >>> config.get(\'closet\', \'monster\',\n ... fallback=\'No such things as monsters\')\n \'No such things as monsters\'\n \n* ``ConfigParser`` objects can now read data directly `from strings\n <http://docs.python.org/3/library/configparser.html#configparser.ConfigParser.read_string>`__\n and `from dictionaries\n <http://docs.python.org/3/library/configparser.html#configparser.ConfigParser.read_dict>`__.\n That means importing configuration from JSON or specifying default values for\n the whole configuration (multiple sections) is now a single line of code. Same\n goes for copying data from another ``ConfigParser`` instance, thanks to its\n mapping protocol support. \n\n* many smaller tweaks, updates and fixes\n\nA few words about Unicode\n-------------------------\n\n``configparser`` comes from Python 3 and as such it works well with Unicode.\nThe library is generally cleaned up in terms of internal data storage and\nreading/writing files. There are a couple of incompatibilities with the old\n``ConfigParser`` due to that. However, the work required to migrate is well\nworth it as it shows the issues that would likely come up during migration of\nyour project to Python 3.\n\nThe design assumes that Unicode strings are used whenever possible [1]_. That\ngives you the certainty that what\'s stored in a configuration object is text.\nOnce your configuration is read, the rest of your application doesn\'t have to\ndeal with encoding issues. All you have is text [2]_. The only two phases when\nyou should explicitly state encoding is when you either read from an external\nsource (e.g. a file) or write back. \n\nVersioning\n----------\n\nThis backport is intended to keep 100% compatibility with the vanilla release in\nPython 3.2+. To help maintaining a version you want and expect, a versioning\nscheme is used where:\n\n* the first three numbers indicate the version of Python 3.x from which the\n backport is done\n\n* a backport release number is provided after the ``r`` letter\n\nFor example, ``3.3.0r1`` is the **first** release of ``configparser`` compatible\nwith the library found in Python **3.3.0**.\n\nA single exception from the 100% compatibility principle is that bugs fixed\nbefore releasing another minor Python 3.x.y version **will be included** in the\nbackport releases done in the mean time. This rule applies to bugs only.\n\nMaintenance\n-----------\n\nThis backport is maintained on BitBucket by Łukasz Langa, the current vanilla\n``configparser`` maintainer for CPython:\n\n* `configparser Mercurial repository <https://bitbucket.org/ambv/configparser>`_\n\n* `configparser issue tracker <https://bitbucket.org/ambv/configparser/issues>`_ \n\nChange Log\n----------\n\n3.3.0r2\n~~~~~~~\n\n* updated the fix for `#16820 <http://bugs.python.org/issue16820>`_: parsers\n now preserve section order when using ``__setitem__`` and ``update``\n\n3.3.0r1\n~~~~~~~\n\n* compatible with 3.3.0 + fixes for `#15803\n <http://bugs.python.org/issue15803>`_ and `#16820\n <http://bugs.python.org/issue16820>`_\n\n* fixes `BitBucket issue #4\n <https://bitbucket.org/ambv/configparser/issue/4>`_: ``read()`` properly\n treats a bytestring argument as a filename\n\n* `ordereddict <http://pypi.python.org/pypi/ordereddict>`_ dependency required\n only for Python 2.6\n\n* `unittest2 <http://pypi.python.org/pypi/unittest2>`_ explicit dependency\n dropped. If you want to test the release, add ``unittest2`` on your own.\n\n3.2.0r3\n~~~~~~~\n\n* proper Python 2.6 support\n\n * explicitly stated the dependency on `ordereddict\n <http://pypi.python.org/pypi/ordereddict>`_\n\n * numbered all formatting braces in strings\n\n* explicitly says that Python 2.5 support won\'t happen (too much work necessary\n without abstract base classes, string formatters, the ``io`` library, etc.)\n\n* some healthy advertising in the README\n\n3.2.0r2\n~~~~~~~\n\n* a backport-specific change: for convenience and basic compatibility with the\n old ConfigParser, bytestrings are now accepted as section names, options and\n values. Those strings are still converted to Unicode for internal storage so\n in any case when such conversion is not possible (using the \'ascii\' codec),\n UnicodeDecodeError is raised.\n\n3.2.0r1\n~~~~~~~\n\n* the first public release compatible with 3.2.0 + fixes for `#11324\n <http://bugs.python.org/issue11324>`_, `#11670\n <http://bugs.python.org/issue11670>`_ and `#11858\n <http://bugs.python.org/issue11858>`_.\n\nConversion Process\n------------------\n\nThis section is technical and should bother you only if you are wondering how\nthis backport is produced. If the implementation details of this backport are\nnot important for you, feel free to ignore the following content.\n\n``configparser`` is converted using `3to2 <http://pypi.python.org/pypi/3to2>`_.\nBecause a fully automatic conversion was not doable, I took the following\nbranching approach:\n\n* the ``3.x`` branch holds unchanged files synchronized from the upstream\n CPython repository. The synchronization is currently done by manually copying\n the required files and stating from which CPython changeset they come from.\n\n* the ``3.x-clean`` branch holds a version of the ``3.x`` code with some tweaks\n that make it independent from libraries and constructions unavailable on 2.x.\n Code on this branch still *must* work on the corresponding Python 3.x. You\n can check this running the supplied unit tests.\n\n* the ``default`` branch holds necessary changes which break unit tests on\n Python 3.2. Additional files which are used by the backport are also stored\n here.\n\nThe process works like this:\n\n1. I update the ``3.x`` branch with new versions of files. Commit.\n\n2. I merge the new commit to ``3.x-clean``. Check unit tests. Commit.\n\n3. If there are necessary changes that can be made in a 3.x compatible manner,\n I do them now (still on ``3.x-clean``), check unit tests and commit. If I\'m\n not yet aware of any, no problem.\n\n4. I merge the changes from ``3.x-clean`` to ``default``. Commit.\n\n5. If there are necessary changes that *cannot* be made in a 3.x compatible\n manner, I do them now (on ``default``). Note that the changes should still\n be written using 3.x syntax. If I\'m not yet aware of any required changes,\n no problem.\n\n6. I run ``./convert.py`` which is a custom ``3to2`` runner for this project.\n\n7. I run the unit tests with ``unittest2`` on Python 2.x. If the tests are OK,\n I can prepare a new release. Otherwise, I revert the ``default`` branch to\n its previous state (``hg revert .``) and go back to Step 3.\n\n**NOTE:** the ``default`` branch holds unconverted code. This is because keeping\nthe conversion step as the last (after any custom changes) helps managing the\nhistory better. Plus, the merges are nicer and updates of the converter software\ndon\'t create nasty conflicts in the repository.\n\nThis process works well but if you have any tips on how to make it simpler and\nfaster, do enlighten me :)\n\nFootnotes\n---------\n\n.. [1] To somewhat ease migration, passing bytestrings is still supported but\n they are converted to Unicode for internal storage anyway. This means\n that for the vast majority of strings used in configuration files, it\n won\'t matter if you pass them as bytestrings or Unicode. However, if you\n pass a bytestring that cannot be converted to Unicode using the naive\n ASCII codec, a ``UnicodeDecodeError`` will be raised. This is purposeful\n and helps you manage proper encoding for all content you store in\n memory, read from various sources and write back.\n\n.. [2] Life gets much easier when you understand that you basically manage\n **text** in your application. You don\'t care about bytes but about\n letters. In that regard the concept of content encoding is meaningless.\n The only time when you deal with raw bytes is when you write the data to\n a file. Then you have to specify how your text should be encoded. On\n the other end, to get meaningful text from a file, the application\n reading it has to know which encoding was used during its creation. But\n once the bytes are read and properly decoded, all you have is text. This\n is especially powerful when you start interacting with multiple data\n sources. Even if each of them uses a different encoding, inside your\n application data is held in abstract text form. You can program your\n business logic without worrying about which data came from which source.\n You can freely exchange the data you store between sources. Only\n reading/writing files requires encoding your text to bytes.',
'docs_url': '',
'download_url': 'UNKNOWN',
'home_page': 'http://docs.python.org/3/library/configparser.html',
'keywords': 'configparser ini parsing conf cfg configuration file',
'license': 'MIT',
'maintainer': None,
'maintainer_email': None,
'name': 'configparser',
'package_url': 'http://pypi.python.org/pypi/configparser',
'platform': 'any',
'release_url': 'http://pypi.python.org/pypi/configparser/3.3.0r2',
'requires_python': None,
'stable_version': None,
'summary': 'This library brings the updated configparser from Python 3.2+ to Python 2.6-2.7.',
'version': '3.3.0r2'},
'urls': [{...}]},
'headers': [('Date', 'Thu, 15 Aug 2013 06:17:52 GMT'),
('Content-Type', 'application/json; charset="UTF-8"'),
('Content-Disposition', 'inline'),
('Strict-Transport-Security', 'max-age=31536000'),
('Content-Length', ''),
('Accept-Ranges', 'bytes'),
('Age', ''),
('Connection', 'close')]}
'##################################################'
[('Date',
'Thu, 15 Aug 2013 06:17:52 GMT'),
('Content-Type',
'application/json; charset="UTF-8"'),
('Content-Disposition',
'inline'),
('Strict-Transport-Security',
'max-age=31536000'),
('Content-Length', ''),
('Accept-Ranges', 'bytes'),
('Age', ''),
('Connection', 'close')]
'##################################################'
[<Recursion on list with id=39183984>, 'a', 'c', 'e', 'd', '']
>>>

python开发_pprint()的更多相关文章

  1. python开发环境搭建

    虽然网上有很多python开发环境搭建的文章,不过重复造轮子还是要的,记录一下过程,方便自己以后配置,也方便正在学习中的同事配置他们的环境. 1.准备好安装包 1)上python官网下载python运 ...

  2. 【Machine Learning】Python开发工具:Anaconda+Sublime

    Python开发工具:Anaconda+Sublime 作者:白宁超 2016年12月23日21:24:51 摘要:随着机器学习和深度学习的热潮,各种图书层出不穷.然而多数是基础理论知识介绍,缺乏实现 ...

  3. Python开发工具PyCharm个性化设置(图解)

    Python开发工具PyCharm个性化设置,包括设置默认PyCharm解析器.设置缩进符为制表符.设置IDE皮肤主题等,大家参考使用吧. JetBrains PyCharm Pro 4.5.3 中文 ...

  4. Python黑帽编程1.2 基于VS Code构建Python开发环境

    Python黑帽编程1.2  基于VS Code构建Python开发环境 0.1  本系列教程说明 本系列教程,采用的大纲母本为<Understanding Network Hacks Atta ...

  5. Eclipse中Python开发环境搭建

    Eclipse中Python开发环境搭建  目 录  1.背景介绍 2.Python安装 3.插件PyDev安装 4.测试Demo演示 一.背景介绍 Eclipse是一款基于Java的可扩展开发平台. ...

  6. Python开发:环境搭建(python3、PyCharm)

    Python开发:环境搭建(python3.PyCharm) python3版本安装 PyCharm使用(完全图解(最新经典))

  7. Python 开发轻量级爬虫08

    Python 开发轻量级爬虫 (imooc总结08--爬虫实例--分析目标) 怎么开发一个爬虫?开发一个爬虫包含哪些步骤呢? 1.确定要抓取得目标,即抓取哪些网站的哪些网页的哪部分数据. 本实例确定抓 ...

  8. Python 开发轻量级爬虫07

    Python 开发轻量级爬虫 (imooc总结07--网页解析器BeautifulSoup) BeautifulSoup下载和安装 使用pip install 安装:在命令行cmd之后输入,pip i ...

  9. Python 开发轻量级爬虫06

    Python 开发轻量级爬虫 (imooc总结06--网页解析器) 介绍网页解析器 将互联网的网页获取到本地以后,我们需要对它们进行解析才能够提取出我们需要的内容. 也就是说网页解析器是从网页中提取有 ...

随机推荐

  1. 基于Node的Web聊天室

    1 项目名称 Web聊天室(<这是NodeJs实战>第二章的一个案例,把整个开发过程记录下来)

  2. python基本数据类型list,tuple,set,dict用法以及遍历方法

    1.list类型 类似于java的list类型,数据集合,可以追加元素与删除元素. 遍历list可以用下标进行遍历,也可以用迭代器遍历list集合 建立list的时候用[]括号 import sys ...

  3. php sprintf格式化注入

    URL:http://efa4e2c2b8df4ce69454639f4e3727071652c31167f341a4.game.ichunqiu.com/ 简单的说就是sprintf中%1$\'会将 ...

  4. linux wc命令的作用。

    Linux系统中的wc(Word Count)命令的功能为统计指定文件中的字节数.字数.行数,并将统计结果显示输出. 1.命令格式: wc [选项]文件... 2.命令功能: 统计指定文件中的字节数. ...

  5. C#开发微信公众平台开发-微信海报介绍和开发流程

    “让客户发展客户”,微信海报才是微信公众平台最高明的吸粉手段,海报上有粉丝的专属二维码,有粉丝的头像及商户宣传的广告等.新粉丝扫描这个专属二维码会关注公众号,同时分享海报的粉丝会增加积分换取礼品或者优 ...

  6. 设计模式之笔记--外观模式(Facade)

    外观模式(Facade) 定义 外观模式(Facade),为子系统中的一组接口提供一个一致的界面,此模式定义了一个高层接口,这个接口使得这一子系统更加容易使用. 类图 描述 Facade:外观类,外观 ...

  7. Python下urllib2应用

    #coding=utf-8 import urllib,urllib2 url = 'http://www.xxx.com' values = {'wd' : 'python', 'language' ...

  8. [ python ] 初始面向对象

    首先,通过之前学习的函数编写一个 人狗大战 的例子. 分析下这个需求,人 狗 大战  三个事情.角色:人.狗动作:狗咬人,人打狗 先创建人和狗两个角色: def person(name, hp, ag ...

  9. Vue.js——60分钟快速入门(转)

    var vm = new Vue({ el: '#app', data: { people: [{ name: 'Jack', age: 30, sex: 'Male' }, { name: 'Bil ...

  10. LightOJ 1414 February 29(闰年统计+容斥原理)

    题目链接:https://vjudge.net/contest/28079#problem/R 题目大意:给你分别给你两个日期(第二个日期大于等于第一个日期),闰年的2月29日称为闰日,让你求两个日期 ...