Python's JSON module and OS module

Source: Internet
Author: User
Tags javascript array

The JSON full name is the JavaScript object Notation (that is, the JavaScript objects tag), which is a subset of JavaScript.

Front-end and back-end data interaction, in fact, JS and Python for data interaction

Interface One: Json.dumps (obj) # converts the Obj object into a JSON string

Interface two: Json.loads (s) # convert s This JSON string to Python data type

Interface three: Json.dump (obj,f) #将obj这个对象转成成JSON对象写入f文件

Interface four: Json.load (f) #读取f文件JSON字符串转成python数据类型

JSON considerations:

1, the name must be enclosed in double quotation marks (i.e.: "") to include

2, the value can be double quotation marks include the string, number, true, false, NULL, JavaScript array, or child object.

Python's JSON module and OS module

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.