推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
liudaqi
V2EX  ›  Python

import json 和 from flask import json 两种方式引入的 json 有什么区别吗?

  •  
  •   liudaqi · Mar 31, 2019 · 3373 views
    This topic created in 2680 days ago, the information mentioned may be changed or developed.
    可以认为 import json 是 from flask import json 的子集吗?
    6 replies    2019-03-31 19:41:38 +08:00
    binux
        1
    binux  
       Mar 31, 2019 via Android
    不同的两个包
    meiyoumingzi6
        2
    meiyoumingzi6  
       Mar 31, 2019 via Android
    你这理解岂不是老子给儿子当子集


    话说 json 怎么也算是 python 官方模块
    flask 可是第三方模块啊
    meiyoumingzi6
        3
    meiyoumingzi6  
       Mar 31, 2019 via Android
    刚看了下 flak 的 json 其中 有一个叫 _json 的东西, 他的 load 等其它方法,最终都有调用 _json 对应的方法, 点进去发现他其实就是 python 官方的 json (其实会 import simplejson as json 如果异常就是官方的 json)
    CEBBCAT
        4
    CEBBCAT  
       Mar 31, 2019 via Android
    基础知识……复习下 import 就 OK 了

    提问前请搜索
    sparkssssssss
        5
    sparkssssssss  
       Mar 31, 2019 via iPhone
    撸主在当前目录建立个 json.py. 然后也可以导入啊
    SingeeKing
        6
    SingeeKing  
    PRO
       Mar 31, 2019
    @meiyoumingzi6 #2 非要这么说其实是可以的,因为 flask 的 json 包括了官方库的 json
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2781 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 05:33 · PVG 13:33 · LAX 22:33 · JFK 01:33
    ♥ Do have faith in what you're doing.