python开发_pprint()
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()的更多相关文章
- python开发环境搭建
虽然网上有很多python开发环境搭建的文章,不过重复造轮子还是要的,记录一下过程,方便自己以后配置,也方便正在学习中的同事配置他们的环境. 1.准备好安装包 1)上python官网下载python运 ...
- 【Machine Learning】Python开发工具:Anaconda+Sublime
Python开发工具:Anaconda+Sublime 作者:白宁超 2016年12月23日21:24:51 摘要:随着机器学习和深度学习的热潮,各种图书层出不穷.然而多数是基础理论知识介绍,缺乏实现 ...
- Python开发工具PyCharm个性化设置(图解)
Python开发工具PyCharm个性化设置,包括设置默认PyCharm解析器.设置缩进符为制表符.设置IDE皮肤主题等,大家参考使用吧. JetBrains PyCharm Pro 4.5.3 中文 ...
- Python黑帽编程1.2 基于VS Code构建Python开发环境
Python黑帽编程1.2 基于VS Code构建Python开发环境 0.1 本系列教程说明 本系列教程,采用的大纲母本为<Understanding Network Hacks Atta ...
- Eclipse中Python开发环境搭建
Eclipse中Python开发环境搭建 目 录 1.背景介绍 2.Python安装 3.插件PyDev安装 4.测试Demo演示 一.背景介绍 Eclipse是一款基于Java的可扩展开发平台. ...
- Python开发:环境搭建(python3、PyCharm)
Python开发:环境搭建(python3.PyCharm) python3版本安装 PyCharm使用(完全图解(最新经典))
- Python 开发轻量级爬虫08
Python 开发轻量级爬虫 (imooc总结08--爬虫实例--分析目标) 怎么开发一个爬虫?开发一个爬虫包含哪些步骤呢? 1.确定要抓取得目标,即抓取哪些网站的哪些网页的哪部分数据. 本实例确定抓 ...
- Python 开发轻量级爬虫07
Python 开发轻量级爬虫 (imooc总结07--网页解析器BeautifulSoup) BeautifulSoup下载和安装 使用pip install 安装:在命令行cmd之后输入,pip i ...
- Python 开发轻量级爬虫06
Python 开发轻量级爬虫 (imooc总结06--网页解析器) 介绍网页解析器 将互联网的网页获取到本地以后,我们需要对它们进行解析才能够提取出我们需要的内容. 也就是说网页解析器是从网页中提取有 ...
随机推荐
- JSON与JS的区别以及转换
JSON是什么?(JSON和JavaScript对象有什么区别?)如何把JS对象转化为JSON字符串,又如何把JSON字符串转化为JavaScript对象? JSON (JavaScript Obje ...
- 64_n2
nodejs-from-0.1.3-4.fc26.noarch.rpm 11-Feb-2017 15:01 9982 nodejs-from2-2.1.0-6.fc26.noarch.rpm 11-F ...
- MySQL5.6 新特性之GTID【转】
转自 MySQL5.6 新特性之GTID - jyzhou - 博客园http://www.cnblogs.com/zhoujinyi/p/4717951.html 背景: MySQL5.6在5.5的 ...
- python requests模块手动设置cookies的几种方式
def use_cookie(self): cookies="YF-V5-G0=731b77772529a1f49eac82a9d2c2957f; SUB=_2AkMsEgief8NxqwJ ...
- Shell语言系列之一:文件处理
前言   标准输入/输出可能是软件工具设计原则里最基本的观念了.有很多UNIX程序都遵循这一设计历练.默认情况下,他们会读取标准输入,写入标准输出,并将错误信息传递给标准错误输出. & ...
- 20165301 2017-2018-2 《Java程序设计》第三周学习总结
20165301 2017-2018-2 <Java程序设计>第三周学习总结 教材学习内容总结 第四章:类与对象 类: 类的声明:class+类名 类体:成员变量的声明+方法(局部变量+语 ...
- Mybatis的关联映射
实际的开发中,对数据库的操作常常会涉及到多张表,这在面向对象中就涉及到了对象与对象之间的关联关系.针对多表之间的操作,MyBatis提供了关联映射, 通过关联映射就可以很好的处理对象与对象之间的关联关 ...
- linux 命令route add default dev eth0和route add default gw eth0的区别?
https://blog.csdn.net/zhaogezhuoyuezhao/article/details/7339220
- 解决IE的背景颜色透明子元素不透明问题
假设背景为黑色,70%半透明,对需要半透明的层用如下CSS background-color: #000000; /* background color for IE */ filter: alpha ...
- 编辑器之Sublime Text3、Notepad++
Sublime text 3 破解版是一款极其强大的代码编辑器,又是一款可以代替记事本的文本编辑器.Sublime text 3拥有着美观的界面和实用的功能,既能够完成代码的编辑又能够完成文本编辑,还 ...