Python JSON

JSON - —ç—Ç–æ –ø–æ–ø—É–ª—è—Ä–Ω—ã–π —Ñ–æ—Ä–º–∞—Ç –¥–∞–Ω–Ω—ã—Ö, –∏—Å–ø–æ–ª—å–∑—É–µ–º—ã–π –¥–ª—è —Ö—Ä–∞–Ω–µ–Ω–∏—è —Å—Ç—Ä—É–∫—Ç—É—Ä–∏—Ä–æ–≤–∞–Ω–Ω—ã—Ö –¥–∞–Ω–Ω—ã—Ö.

–ü—Ä–∏ —Å–æ–∑–¥–∞–Ω–∏–∏ –ø—Ä–∏–ª–æ–∂–µ–Ω–∏—è –Ω–∞ Python –≤—ã –º–æ–∂–µ—Ç–µ —Ä–µ—à–∏—Ç—å, —á—Ç–æ —Ö–æ—Ç–∏—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å JSON –≤ —Å–≤–æ–µ–º –ø—Ä–∏–ª–æ–∂–µ–Ω–∏–∏. –ù–∞–ø—Ä–∏–º–µ—Ä, –≤—ã –º–æ–∂–µ—Ç–µ –∑–∞—Ö–æ—Ç–µ—Ç—å –ø—Ä–æ—á–∏—Ç–∞—Ç—å –¥–∞–Ω–Ω—ã–µ –∏–∑ —Ñ–∞–π–ª–∞ JSON –∏–ª–∏ –∑–∞–ø–∏—Å–∞—Ç—å –¥–∞–Ω–Ω—ã–µ, —Ö—Ä–∞–Ω—è—â–∏–µ—Å—è –≤ —Ñ–æ—Ä–º–∞—Ç–µ JSON, –≤ —Ñ–∞–π–ª.

–í —ç—Ç–æ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ –º—ã —Ä–∞–∑–±–µ—Ä–µ–º –æ—Å–Ω–æ–≤—ã —Ñ–æ—Ä–º–∞—Ç –¥–∞–Ω–Ω—ã—Ö JSON, –∫–∞–∫ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –º–æ–¥—É–ª—å Python json –∏ –∫–∞–∫ —Ä–∞–±–æ—Ç–∞—Ç—å —Å JSON –≤ Python. –ö –∫–æ–Ω—Ü—É —á—Ç–µ–Ω–∏—è —ç—Ç–æ–≥–æ —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–∞ –≤—ã —Å—Ç–∞–Ω–µ—Ç–µ —ç–∫—Å–ø–µ—Ä—Ç–æ–º –≤ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏–∏ JSON –≤ —Å–≤–æ–∏—Ö –ø—Ä–æ–≥—Ä–∞–º–º–∞—Ö –Ω–∞ Python!

–ß—Ç–æ —Ç–∞–∫–æ–µ JSON?

JSON, —Å–æ–∫—Ä–∞—â–µ–Ω–Ω–æ –æ—Ç JavaScript. –ù–æ—Ç–∞—Ü–∏—è –æ–±—ä–µ–∫—Ç–æ–≤ - —ç—Ç–æ —Ñ–æ—Ä–º–∞—Ç –¥–∞–Ω–Ω—ã—Ö, –∫–æ—Ç–æ—Ä—ã–π –ø–æ–∑–≤–æ–ª—è–µ—Ç —Ö—Ä–∞–Ω–∏—Ç—å —Å—Ç—Ä—É–∫—Ç—É—Ä–∏—Ä–æ–≤–∞–Ω–Ω—ã–µ –¥–∞–Ω–Ω—ã–µ.

–ß–∞—Å—Ç–æ JSON –∏—Å–ø–æ–ª—å–∑—É–µ—Ç—Å—è –¥–ª—è –æ—Ç–ø—Ä–∞–≤–∫–∏ –¥–∞–Ω–Ω—ã—Ö –Ω–∞ —Å–µ—Ä–≤–µ—Ä –∏ —Å —Å–µ—Ä–≤–µ—Ä–∞ –≤ –≤–µ–±-–ø—Ä–∏–ª–æ–∂–µ–Ω–∏–∏. –í—ã –º–æ–≥–ª–∏ –≤–∏–¥–µ—Ç—å, –Ω–∞–ø—Ä–∏–º–µ—Ä, —á—Ç–æ –º–Ω–æ–≥–∏–µ API, —Ç–∞–∫–∏–µ –∫–∞–∫ Fitbit API –∏–ª–∏ API –ö–∞—Ä—Ç Google, –≤–æ–∑–≤—Ä–∞—â–∞—é—Ç –¥–∞–Ω–Ω—ã–µ –≤ —Ñ–æ—Ä–º–∞—Ç–µ JSON

–≠—Ç–æ –ø–æ—Ç–æ–º—É, —á—Ç–æ –¥–∞–Ω–Ω—ã–µ JSON —Å—Ç–∞–Ω–¥–∞—Ä—Ç–∏–∑–∏—Ä–æ–≤–∞–Ω—ã, —Å—Ç—Ä—É–∫—Ç—É—Ä–∏—Ä–æ–≤–∞–Ω—ã –∏ –ø—Ä–æ—Å—Ç—ã –¥–ª—è —á—Ç–µ–Ω–∏—è.

–í–æ—Ç –ø—Ä–∏–º–µ—Ä –∑–∞–ø–∏—Å–∏ JSON –≤ Python:

–í —ç—Ç–æ–π –∑–∞–ø–∏—Å–∏ —Ö—Ä–∞–Ω—è—Ç—Å—è —Ç—Ä–∏ –∫–ª—é—á–∞, –∫–æ—Ç–æ—Ä—ã–µ –Ω–∞—Ö–æ–¥—è—Ç—Å—è —Å–ª–µ–≤–∞ –¥–≤–æ–µ—Ç–æ—á–∏–π (:) –∏ —Ç—Ä–∏ –∑–Ω–∞—á–µ–Ω–∏—è, –∫–æ—Ç–æ—Ä—ã–µ —Ö—Ä–∞–Ω—è—Ç—Å—è —Å–ø—Ä–∞–≤–∞ –æ—Ç –¥–≤–æ–µ—Ç–æ—á–∏–π. –ö–∞–∂–¥—ã–π –∫–ª—é—á –ø—Ä–∏–≤—è–∑–∞–Ω –∫ –∑–Ω–∞—á–µ–Ω–∏—é.

81% —É—á–∞—Å—Ç–Ω–∏–∫–æ–≤ –∑–∞—è–≤–∏–ª–∏, —á—Ç–æ –æ–Ω–∏ –ø–æ—á—É–≤—Å—Ç–≤–æ–≤–∞–ª–∏ —Å–µ–±—è –±–æ–ª–µ–µ —É–≤–µ—Ä–µ–Ω–Ω—ã–º–∏ –≤ —Å–≤–æ–∏—Ö –ø–µ—Ä—Å–ø–µ–∫—Ç–∏–≤–∞—Ö —Ç—Ä—É–¥–æ—É—Å—Ç—Ä–æ–π—Å—Ç–≤–∞ –≤ —Å—Ñ–µ—Ä–µ –≤—ã—Å–æ–∫–∏—Ö —Ç–µ—Ö–Ω–æ–ª–æ–≥–∏–π –ø–æ—Å–ª–µ –ø–æ—Å–µ—â–µ–Ω–∏—è —É—á–µ–±–Ω–æ–≥–æ –∫—É—Ä—Å–∞. –ù–∞–π–¥–∏—Ç–µ –ø–æ–¥—Ö–æ–¥ –∫ —É—á–µ–±–Ω–æ–º—É –ª–∞–≥–µ—Ä—é —Å–µ–≥–æ–¥–Ω—è.

–°—Ä–µ–¥–Ω–∏–π –≤—ã–ø—É—Å–∫–Ω–∏–∫ —É—á–µ–±–Ω–æ–≥–æ –ª–∞–≥–µ—Ä—è –ø–æ—Ç—Ä–∞—Ç–∏–ª –º–µ–Ω–µ–µ —à–µ—Å—Ç–∏ –º–µ—Å—è—Ü–µ–≤ –Ω–∞ —Å–º–µ–Ω—É –∫–∞—Ä—å–µ—Ä—ã, –æ—Ç –Ω–∞—á–∞–ª–∞ —É—á–µ–±–Ω–æ–≥–æ –ª–∞–≥–µ—Ä—è –¥–æ –ø–æ–∏—Å–∫–∞ —Å–≤–æ–µ–π –ø–µ—Ä–≤–æ–π —Ä–∞–±–æ—Ç—ã.

–§–æ—Ä–º–∞—Ç –¥–∞–Ω–Ω—ã—Ö JSON –Ω–µ –¥–æ–ª–∂–µ–Ω –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å—Å—è. —Å–ø—É—Ç–∞—Ç—å —Å–æ —Å–ª–æ–≤–∞—Ä–µ–º. –•–æ—Ç—è —ç—Ç–æ –º–æ–∂–µ—Ç –≤—ã–≥–ª—è–¥–µ—Ç—å –∫–∞–∫ —Å–ª–æ–≤–∞—Ä—å, JSON - —ç—Ç–æ —Ñ–æ—Ä–º–∞—Ç –¥–∞–Ω–Ω—ã—Ö, —Ç–æ–≥–¥–∞ –∫–∞–∫ —Å–ª–æ–≤–∞—Ä—å - —ç—Ç–æ —Å—Ç—Ä—É–∫—Ç—É—Ä–∞ –¥–∞–Ω–Ω—ã—Ö.

–≠—Ç–æ –æ–∑–Ω–∞—á–∞–µ—Ç, —á—Ç–æ –µ—Å–ª–∏ –≤—ã —Ö–æ—Ç–∏—Ç–µ —Å–æ—Ö—Ä–∞–Ω–∏—Ç—å –¥–∞–Ω–Ω—ã–µ JSON –≤ —Å–ª–æ–≤–∞—Ä–µ, –≤—ã –Ω—É–∂–Ω–æ –±—É–¥–µ—Ç –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞—Ç—å –µ–≥–æ –≤ —Å–ª–æ–≤–∞—Ä—å; –µ—Å–ª–∏ –≤—ã —Ö–æ—Ç–∏—Ç–µ —Å–æ—Ö—Ä–∞–Ω–∏—Ç—å —Å–ª–æ–≤–∞—Ä—å –∫–∞–∫ JSON, –≤–∞–º –Ω–µ–æ–±—Ö–æ–¥–∏–º–æ –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞—Ç—å –µ–≥–æ –≤ JSON.

–ò–º–ø–æ—Ä—Ç–∏—Ä—É–π—Ç–µ json –≤ Python

–ü—Ä–µ–∂–¥–µ —á–µ–º –≤—ã –Ω–∞—á–Ω–µ—Ç–µ —Ä–∞–±–æ—Ç–∞—Ç—å —Å –æ–±—ä–µ–∫—Ç–∞–º–∏ JSON –≤ Python , –≤–∞–º –ø–æ—Ç—Ä–µ–±—É–µ—Ç—Å—è –∏–º–ø–æ—Ä—Ç–∏—Ä–æ–≤–∞—Ç—å json-–º–æ–¥—É–ª—å Python. –≠—Ç–æ—Ç –º–æ–¥—É–ª—å –≤–∫–ª—é—á–∞–µ—Ç —Ä—è–¥ —Ñ—É–Ω–∫—Ü–∏–π, –∫–æ—Ç–æ—Ä—ã–µ –ø–æ–∑–≤–æ–ª—è—é—Ç —Ä–∞–±–æ—Ç–∞—Ç—å —Å –¥–∞–Ω–Ω—ã–º–∏ JSON.

–ß—Ç–æ–±—ã –∏–º–ø–æ—Ä—Ç–∏—Ä–æ–≤–∞—Ç—å –º–æ–¥—É–ª—å JSON, –≤—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —ç—Ç–æ—Ç –æ–ø–µ—Ä–∞—Ç–æ—Ä:

import json

–¢–µ–ø–µ—Ä—å, –∫–æ–≥–¥–∞ –º—ã –∏–º–ø–æ—Ä—Ç–∏—Ä–æ–≤–∞–ª–∏ –º–æ–¥—É–ª—å JSON –≤ –≤–∞—à –∫–æ–¥, –º—ã –º–æ–∂–µ–º –Ω–∞—á–∞—Ç—å —Ä–∞–±–æ—Ç—É —Å –µ–≥–æ —Ñ—É–Ω–∫—Ü–∏–∏.

–†–∞–∑–±–æ—Ä JSON –≤ Python

–û–¥–Ω–∞ –∏–∑ –Ω–∞–∏–±–æ–ª–µ–µ –≤–∞–∂–Ω—ã—Ö —Ñ—É–Ω–∫—Ü–∏–π, –∫–æ—Ç–æ—Ä—ã–µ –≤–∞–º –Ω—É–∂–Ω–æ –±—É–¥–µ—Ç –≤—ã–ø–æ–ª–Ω—è—Ç—å, –∫–æ–≥–¥–∞ –¥–µ–ª–æ –¥–æ—Ö–æ–¥–∏—Ç –¥–æ —Ä–∞–±–æ—Ç—ã —Å –¥–∞–Ω–Ω—ã–º–∏ JSON, - —ç—Ç–æ –∞–Ω–∞–ª–∏–∑ JSON –≤ —Å–ª–æ–≤–∞—Ä–µ. .

–ß—Ç–æ–±—ã –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞—Ç—å JSON –≤ —Å–ª–æ–≤–∞—Ä—å, –≤—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –º–µ—Ç–æ–¥ json.loads ().

json .loads () –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –æ–¥–∏–Ω –ø–∞—Ä–∞–º–µ—Ç—Ä: —Å—Ç—Ä–æ–∫—É JSON, –∫–æ—Ç–æ—Ä—É—é –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞—Ç—å –≤ —Å–ª–æ–≤–∞—Ä—å.

–ü—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, —É –≤–∞—Å –µ—Å—Ç—å —Å—Ç—Ä–æ–∫–∞ JSON, –≤ –∫–æ—Ç–æ—Ä–æ–π —Ö—Ä–∞–Ω–∏—Ç—Å—è –∏–Ω—Ñ–æ—Ä–º–∞—Ü–∏—è –æ –ø—Ä–æ–µ–∫—Ç–∞—Ö, –∫–æ—Ç–æ—Ä—ã–º –Ω–∞–∑–Ω–∞—á–µ–Ω –∫–æ–¥–∏—Ä–æ–≤—â–∏–∫ –≤ –≥—Ä—É–ø–ø–µ –∏–Ω–∂–µ–Ω–µ—Ä–æ–≤. –í—ã —Ö–æ—Ç–∏—Ç–µ –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞—Ç—å —ç—Ç—É —Å—Ç—Ä–æ–∫—É JSON –≤ —Å–ª–æ–≤–∞—Ä—å. –î–ª—è —ç—Ç–æ–≥–æ –≤—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Å–ª–µ–¥—É—é—â–∏–π –∫–æ–¥:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç:

{" name & rsquo ;: " Linda Richardson & rsquo ;, " projects & rsquo ;: [" Directory " " Homepage "]}

–õ–∏–Ω–¥–∞ –†–∏—á–∞—Ä–¥—Å–æ–Ω

–î–∞–≤–∞–π—Ç–µ —Ä–∞–∑–±–µ—Ä–µ–º –Ω–∞—à –∫–æ–¥. –°–Ω–∞—á–∞–ª–∞ –º—ã –∏–º–ø–æ—Ä—Ç–∏—Ä—É–µ–º –º–æ–¥—É–ª—å json –≤ –Ω–∞—à –∫–æ–¥. –ó–∞—Ç–µ–º –º—ã –æ–±—ä—è–≤–ª—è–µ–º —Å—Ç—Ä–æ–∫—É —Å –∏–º–µ–Ω–µ–º employee, –∫–æ—Ç–æ—Ä–∞—è —Ö—Ä–∞–Ω–∏—Ç –∑–∞–ø–∏—Å—å –Ω–∞—à–µ–≥–æ —Å–æ—Ç—Ä—É–¥–Ω–∏–∫–∞ –≤ —Å—Ç—Ä—É–∫—Ç—É—Ä–µ JSON.

–ó–∞—Ç–µ–º –º—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º json.loads (), —á—Ç–æ–±—ã –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞—Ç—å –Ω–∞—à—É —Å—Ç—Ä–æ–∫—É employee –≤ JSON. –ó–∞—Ç–µ–º –º—ã –≤—ã–≤–æ–¥–∏–º –Ω–∞—à –Ω–æ–≤—ã–π —Å–ª–æ–≤–∞—Ä—å –Ω–∞ –∫–æ–Ω—Å–æ–ª—å. –ú—ã —Ç–∞–∫–∂–µ –≤—ã–≤–æ–¥–∏–º –Ω–∞ –∫–æ–Ω—Å–æ–ª—å –∑–Ω–∞—á–µ–Ω–∏–µ –∫–ª—é—á–∞ name.

–ö–∞–∫ –≤–∏–¥–∏—Ç–µ, –Ω–∞—à —Å–ª–æ–≤–∞—Ä—å –≤—ã–≥–ª—è–¥–∏—Ç —Ç–∞–∫ –∂–µ, –∫–∞–∫ –Ω–∞—à–∞ —Å—Ç—Ä–æ–∫–∞ JSON. –ù–æ —Ç–µ–ø–µ—Ä—å –Ω–∞—à–∏ –¥–∞–Ω–Ω—ã–µ —Ö—Ä–∞–Ω—è—Ç—Å—è –≤ –≤–∏–¥–µ —Å–ª–æ–≤–∞—Ä—è. –ú—ã –º–æ–∂–µ–º —Å–∫–∞–∑–∞—Ç—å, –ø–æ—Ç–æ–º—É —á—Ç–æ, –∫–æ–≥–¥–∞ –º—ã —Ä–∞—Å–ø–µ—á–∞—Ç—ã–≤–∞–µ–º –∑–Ω–∞—á–µ–Ω–∏–µ " name " –∫–ª—é—á, " –õ–∏–Ω–¥–∞ –†–∏—á–∞—Ä–¥—Å–æ–Ω " –≤—ã–≤–æ–¥–∏—Ç—Å—è –Ω–∞ –∫–æ–Ω—Å–æ–ª—å.

–ü—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞—Ç—å —Å–ª–æ–≤–∞—Ä—å –≤ —Å—Ç—Ä–æ–∫—É JSON

–ö–æ–≥–¥–∞ –≤—ã —Ä–∞–±–æ—Ç–∞–µ—Ç–µ —Å–æ —Å–ª–æ–≤–∞—Ä–µ–º, –≤—ã –º–æ–∂–µ—Ç–µ –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞—Ç—å –µ–≥–æ –≤ —Å—Ç—Ä–æ–∫—É JSON.

–≠—Ç–æ –æ–±—ã—á–Ω–∞—è –æ–ø–µ—Ä–∞—Ü–∏—è, –ø–æ—Ç–æ–º—É —á—Ç–æ, –ø–æ—Å–∫–æ–ª—å–∫—É –≤—ã —Å–æ—Ö—Ä–∞–Ω—è–µ—Ç–µ –∑–Ω–∞—á–µ–Ω–∏–µ JSON –≤ —Ñ–∞–π–ª, –æ–Ω–æ –¥–æ–ª–∂–Ω–æ –±—ã—Ç—å –æ—Ç—Ñ–æ—Ä–º–∞—Ç–∏—Ä–æ–≤–∞–Ω–æ –∫–∞–∫ —Å—Ç—Ä–æ–∫–∞. –ß—Ç–æ–±—ã –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞—Ç—å —Å–ª–æ–≤–∞—Ä—å –≤ JSON, –º—ã –º–æ–∂–µ–º –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –º–µ—Ç–æ–¥ json.dumps ().

"–ö–∞—Ä—å–µ—Ä–Ω–∞—è –∫–∞—Ä–º–∞ –≤–æ—à–ª–∞ –≤ –º–æ—é –∂–∏–∑–Ω—å, –∫–æ–≥–¥–∞ –º–Ω–µ —ç—Ç–æ –±—ã–ª–æ –Ω—É–∂–Ω–æ –±–æ–ª—å—à–µ –≤—Å–µ–≥–æ, –∏ –±—ã—Å—Ç—Ä–æ –ø–æ–º–æ–≥–ª–∞ –º–Ω–µ —Å–æ–≤–º–µ—Å—Ç–∏—Ç–µ —Å —É—á–µ–±–Ω—ã–º –ª–∞–≥–µ—Ä–µ–º. –ß–µ—Ä–µ–∑ –¥–≤–∞ –º–µ—Å—è—Ü–∞ –ø–æ—Å–ª–µ –≤—ã–ø—É—Å–∫–∞ —è –Ω–∞—à–ª–∞ —Ä–∞–±–æ—Ç—É —Å–≤–æ–µ–π –º–µ—á—Ç—ã, –∫–æ—Ç–æ—Ä–∞—è —Å–æ–æ—Ç–≤–µ—Ç—Å—Ç–≤–æ–≤–∞–ª–∞ –º–æ–∏–º —Ü–µ–Ω–Ω–æ—Å—Ç—è–º –∏ —Ü–µ–ª—è–º –≤ –∂–∏–∑–Ω–∏! "

–í–µ–Ω–µ—Ä–∞, –∏–Ω–∂–µ–Ω–µ—Ä-–ø—Ä–æ–≥—Ä–∞–º–º–∏—Å—Ç –≤ Rockbot

–ü—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, –º—ã —Ö–æ—Ç–∏–º –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞—Ç—å —Å–ª–æ–≤–∞—Ä—å —Å –∏–Ω—Ñ–æ—Ä–º–∞—Ü–∏–µ–π –æ —Å–æ—Ç—Ä—É–¥–Ω–∏–∫–µ –≤ —Å—Ç—Ä–æ–∫—É JSON. –ú—ã –º–æ–≥–ª–∏ –±—ã —Å–¥–µ–ª–∞—Ç—å —ç—Ç–æ —Å –ø–æ–º–æ—â—å—é —ç—Ç–æ–≥–æ –∫–æ–¥–∞:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç:

" {" –∏–º—è & rdquo ;: " –õ–∏–Ω–¥–∞ –†–∏—á–∞—Ä–¥—Å–æ–Ω & rdquo ;, " id & rdquo ;: 107, " –∏—Å–ø—ã—Ç–∞—Ç–µ–ª—å–Ω—ã–π —Å—Ä–æ–∫ & rdquo ;: –ª–æ–∂—å, " –æ—Ç–¥–µ–ª & rdquo ;: " –ü—Ä–æ–¥–∞–∂–∏ "}

–•–æ—Ç—è –≤—ã–≤–æ–¥ –Ω–∞—à–µ–≥–æ –∫–æ–¥–∞ –º–æ–∂–µ—Ç –≤—ã–≥–ª—è–¥–µ—Ç—å —Ç–∞–∫ –∂–µ, –∫–∞–∫ –Ω–∞—à –∏—Å—Ö–æ–¥–Ω—ã–π —Å–ª–æ–≤–∞—Ä—å, –Ω–∞—à —Å–ª–æ–≤–∞—Ä—å —Ç–µ–ø–µ—Ä—å —Ö—Ä–∞–Ω–∏—Ç—Å—è –≤ –≤–∏–¥–µ —Å—Ç—Ä–æ–∫–∏. & nbsp;

–§–æ—Ä–º–∞—Ç–∏—Ä–æ–≤–∞–Ω–∏–µ —Å—Ç—Ä–æ–∫–∏ JSON

–ú–µ—Ç–æ–¥ json.dumps () –∏–º–µ–µ—Ç –Ω–µ—Å–∫–æ–ª—å–∫–æ –ø–∞—Ä–∞–º–µ—Ç—Ä–æ–≤, –∫–æ—Ç–æ—Ä—ã–µ –º–æ–∂–Ω–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å, —á—Ç–æ–±—ã —É–ø—Ä–æ—Å—Ç–∏—Ç—å –ø—Ä–æ—á—Ç–∏—Ç–µ –ø–æ—Å–ª–µ–¥–Ω—é—é —Å—Ç—Ä–æ–∫—É, —Å–æ–∑–¥–∞–Ω–Ω—É—é –º–µ—Ç–æ–¥–æ–º.

–ü–∞—Ä–∞–º–µ—Ç—Ä indent –ø–æ–∑–≤–æ–ª—è–µ—Ç –≤–∞–º –æ–ø—Ä–µ–¥–µ–ª–∏—Ç—å –∫–æ–ª–∏—á–µ—Å—Ç–≤–æ –æ—Ç—Å—Ç—É–ø–æ–≤, –∫–æ—Ç–æ—Ä—ã–µ –ø–æ—è–≤–ª—è—é—Ç—Å—è –≤ –ø–æ—Å–ª–µ–¥–Ω–µ–π —Å—Ç—Ä–æ–∫–µ JSON. –ü—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, –≤—ã —Ö–æ—Ç–∏—Ç–µ –¥–æ–±–∞–≤–∏—Ç—å —á–µ—Ç—ã—Ä–µ –æ—Ç—Å—Ç—É–ø–∞ –≤ –∫–∞–∂–¥–æ–π —Å—Ç—Ä–æ–∫–µ —Å—Ç—Ä–æ–∫–∏ JSON. –≠—Ç–æ –º–æ–∂–Ω–æ —Å–¥–µ–ª–∞—Ç—å —Å –ø–æ–º–æ—â—å—é —Å–ª–µ–¥—É—é—â–µ–≥–æ –æ–ø–µ—Ä–∞—Ç–æ—Ä–∞ json.dumps ():

–≠—Ç–æ—Ç –æ–ø–µ—Ä–∞—Ç–æ—Ä –≤ —Å–æ—á–µ—Ç–∞–Ω–∏–∏ —Å –Ω–∞—à–∏–º –ø–æ—Å–ª–µ–¥–Ω–∏–º –ø—Ä–∏–º–µ—Ä–æ–º –≤–µ—Ä–Ω–µ—Ç:

–í—ã —Ç–∞–∫–∂–µ –º–æ–∂–µ—Ç–µ –∏–∑–º–µ–Ω–∏—Ç—å —Ä–∞–∑–¥–µ–ª–∏—Ç–µ–ª–∏ –¥–∞–Ω–Ω—ã—Ö –≤ —Å—Ç—Ä–æ–∫–µ JSON. –ó–Ω–∞—á–µ–Ω–∏—è –ø–æ —É–º–æ–ª—á–∞–Ω–∏—é –¥–ª—è —Ä–∞–∑–¥–µ–ª–∏—Ç–µ–ª–µ–π: & ldquo ;, " –∏ & ldquo ;: & rdquo ;, —á—Ç–æ –æ–∑–Ω–∞—á–∞–µ—Ç, —á—Ç–æ –∫–∞–∂–¥—ã–π –æ–±—ä–µ–∫—Ç –±—É–¥–µ—Ç —Ä–∞–∑–¥–µ–ª–µ–Ω –∑–∞–ø—è—Ç–æ–π, –∞ –∫–∞–∂–¥—ã–π –∫–ª—é—á –∏ –∑–Ω–∞—á–µ–Ω–∏–µ –±—É–¥—É—Ç —Ä–∞–∑–¥–µ–ª—è—Ç—å—Å—è –¥–≤–æ–µ—Ç–æ—á–∏–µ–º.

–ü—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, –º—ã —Ö–æ—Ç–∏–º, —á—Ç–æ–±—ã –Ω–∞—à–∏ –∫–ª—é—á–∏ –∏ –∑–Ω–∞—á–µ–Ω–∏—è –±—ã–ª–∏ —Ä–∞–∑–¥–µ–ª–µ–Ω—ã –∑–Ω–∞–∫–æ–º —Ä–∞–≤–µ–Ω—Å—Ç–≤–∞ (=), –∏ –º—ã —Ö–æ—Ç–∏–º –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –æ—Ç—Å—Ç—É–ø 4. –≠—Ç–æ –º–æ–∂–Ω–æ —Å–¥–µ–ª–∞—Ç—å —Å –ø–æ–º–æ—â—å—é —ç—Ç–æ–≥–æ –æ–ø–µ—Ä–∞—Ç–æ—Ä–∞:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç:

–ö–∞–∫ –≤–∏–¥–∏—Ç–µ, –∫–∞–∂–¥—ã–π –∫–ª—é—á –∏ –∑–Ω–∞—á–µ–Ω–∏–µ –≤ –Ω–∞—à–µ–π —Å—Ç—Ä–æ–∫–µ JSON —Ç–µ–ø–µ—Ä—å —Ä–∞–∑–¥–µ–ª–µ–Ω—ã –∑–Ω–∞–∫–æ–º —Ä–∞–≤–µ–Ω—Å—Ç–≤–∞.

–ß—Ç–µ–Ω–∏–µ —Ñ–∞–π–ª–∞ JSON

–ß—Ç–æ–±—ã –ø—Ä–æ—á–∏—Ç–∞—Ç—å —Ñ–∞–π–ª JSON –≤ Python, –≤—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å json.load (). –≠—Ç–æ—Ç –º–µ—Ç–æ–¥ –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –æ–¥–∏–Ω –ø–∞—Ä–∞–º–µ—Ç—Ä: –æ–±—ä–µ–∫—Ç —Ñ–∞–π–ª–∞, –∫–æ—Ç–æ—Ä—ã–π –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø—Ä–æ—á–∏—Ç–∞—Ç—å –≤ —Å–≤–æ–µ–π –ø—Ä–æ–≥—Ä–∞–º–º–µ.

–ü—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, —É –Ω–∞—Å –µ—Å—Ç—å —Ñ–∞–π–ª —Å –∏–º–µ–Ω–µ–º employee.json, –∫–æ—Ç–æ—Ä—ã–π –º—ã —Ö–æ—Ç–∏–º –∑–∞–≥—Ä—É–∑–∏—Ç—å –≤ –Ω–∞—à—É –ø—Ä–æ–≥—Ä–∞–º–º—É. –°–æ–¥–µ—Ä–∂–∏–º–æ–µ —ç—Ç–æ–≥–æ —Ñ–∞–π–ª–∞ –≤—ã–≥–ª—è–¥–∏—Ç —Å–ª–µ–¥—É—é—â–∏–º –æ–±—Ä–∞–∑–æ–º:

–ú—ã –º–æ–≥–ª–∏ –±—ã —Å–¥–µ–ª–∞—Ç—å —ç—Ç–æ —Å –ø–æ–º–æ—â—å—é —ç—Ç–æ–≥–æ –∫–æ–¥–∞:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç:

{" name & rdquo ;: & ldquo ; –õ–∏–Ω–¥–∞ –†–∏—á–∞—Ä–¥—Å–æ–Ω & rdquo ;, " id & rdquo ;: 107, " –ø—Ä–æ–±–∞—Ü–∏—è & rdquo ;: false}

–í —ç—Ç–æ–º –∫–æ–¥–µ –º—ã —Å–Ω–∞—á–∞–ª–∞ –∏–º–ø–æ—Ä—Ç–∏—Ä—É–µ–º –±–∏–±–ª–∏–æ—Ç–µ–∫—É json. –ó–∞—Ç–µ–º –º—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º –æ–ø–µ—Ä–∞—Ç–æ—Ä with –¥–ª—è —á—Ç–µ–Ω–∏—è –Ω–∞—à–µ–≥–æ —Ñ–∞–π–ª–∞ employee.json. –ú—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º –º–µ—Ç–æ–¥ json.load () –¥–ª—è –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞–Ω–∏—è —Å–æ–¥–µ—Ä–∂–∏–º–æ–≥–æ –Ω–∞—à–µ–≥–æ —Ñ–∞–π–ª–∞, —Ö—Ä–∞–Ω—è—â–µ–≥–æ—Å—è –≤ –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π file, –≤ —Å–ª–æ–≤–∞—Ä—å. –ó–∞—Ç–µ–º –º—ã —Ä–∞—Å–ø–µ—á–∞—Ç—ã–≤–∞–µ–º –∑–Ω–∞—á–µ–Ω–∏–µ –Ω–∞—à–µ–≥–æ —Å–ª–æ–≤–∞—Ä—è.

–ó–∞–ø–∏—Å—å JSON –≤ —Ñ–∞–π–ª

–î–ª—è –∑–∞–ø–∏—Å–∏ JSON –≤ —Ñ–∞–π–ª –≤ Python –º–æ–∂–Ω–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –º–µ—Ç–æ–¥ json.dump (). < br>

–ú–µ—Ç–æ–¥ json.dump () –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –¥–≤–∞ –ø–∞—Ä–∞–º–µ—Ç—Ä–∞: —Å–ª–æ–≤–∞—Ä—å, –∫–æ—Ç–æ—Ä—ã–π –≤—ã —Ö–æ—Ç–∏—Ç–µ –∑–∞–ø–∏—Å–∞—Ç—å –≤ —Ñ–∞–π–ª, –∏ —Ñ–∞–π–ª–æ–≤—ã–π –æ–±—ä–µ–∫—Ç, –∫–æ—Ç–æ—Ä—ã–π –≤—ã —Ö–æ—Ç–∏—Ç–µ –∑–∞–ø–∏—Å–∞—Ç—å –≤ —Å–≤–æ–π —Å–ª–æ–≤–∞—Ä—å. < br>

–ü—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, –º—ã —Ö–æ—Ç–∏–º —Å–æ—Ö—Ä–∞–Ω–∏—Ç—å –∑–∞–ø–∏—Å—å –Ω–∞—à–µ–≥–æ —Å–æ—Ç—Ä—É–¥–Ω–∏–∫–∞ –∫–∞–∫ –∑–Ω–∞—á–µ–Ω–∏–µ JSON –≤ —Ñ–∞–π–ª–µ. –ò–º—è —ç—Ç–æ–≥–æ —Ñ–∞–π–ª–∞ –¥–æ–ª–∂–Ω–æ –±—ã—Ç—å linda_employee.json. –ú—ã –º–æ–≥–ª–∏ –±—ã —Å–¥–µ–ª–∞—Ç—å —ç—Ç–æ, –∏—Å–ø–æ–ª—å–∑—É—è —Å–ª–µ–¥—É—é—â–∏–π –∫–æ–¥:

–î–∞–≤–∞–π—Ç–µ —Ä–∞–∑–±–µ—Ä–µ–º –Ω–∞—à –∫–æ–¥. –°–Ω–∞—á–∞–ª–∞ –º—ã –∏–º–ø–æ—Ä—Ç–∏—Ä—É–µ–º –º–æ–¥—É–ª—å json –≤ –Ω–∞—à –ø—Ä–æ–≥—Ä–∞–º–º–∞. –ó–∞—Ç–µ–º –º—ã –æ–±—ä—è–≤–ª—è–µ–º –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é, –∫–æ—Ç–æ—Ä–∞—è —Ö—Ä–∞–Ω–∏—Ç –∏–Ω—Ñ–æ—Ä–º–∞—Ü–∏—é –æ —Å–æ—Ç—Ä—É–¥–Ω–∏–∫–µ –ø–æ –∏–º–µ–Ω–∏ –õ–∏–Ω–¥–∞ –†–∏—á–∞—Ä–¥—Å–æ–Ω –≤ —Å—Ç—Ä—É–∫—Ç—É—Ä–µ —Å–ª–æ–≤–∞—Ä—è.

–ó–∞—Ç–µ–º –º—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º " —Å " –∑–∞—è–≤–ª–µ–Ω–∏–µ —Å " w " —Ñ–ª–∞–≥ –¥–ª—è –ø–æ–¥–≥–æ—Ç–æ–≤–∫–∏ —Ñ–∞–π–ª–∞ —Å –∏–º–µ–Ω–µ–º linda_employee.json, –≤ –∫–æ—Ç–æ—Ä—ã–π –º—ã –º–æ–∂–µ–º –ø–∏—Å–∞—Ç—å. –ó–∞—Ç–µ–º –º—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º json.dump (), —á—Ç–æ–±—ã –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞—Ç—å –Ω–∞—à —Å–ª–æ–≤–∞—Ä—å employee –≤ —Å—Ç—Ä–æ–∫—É JSON –∏ —Å–æ—Ö—Ä–∞–Ω–∏—Ç—å –µ–µ –≤ –Ω–∞—à–µ–º –æ–±—ä–µ–∫—Ç–µ final_file.

–ü—Ä–∏ –∑–∞–ø—É—Å–∫–µ —ç—Ç–æ–π –ø—Ä–æ–≥—Ä–∞–º–º—ã —Å–æ–¥–µ—Ä–∂–∏–º–æ–µ –Ω–∞—à–µ–≥–æ —Å–ª–æ–≤–∞—Ä—è employee –∑–∞–ø–∏—Å—ã–≤–∞–µ—Ç—Å—è –≤ —Ñ–∞–π–ª linda_employee.json. –û–∫–æ–Ω—á–∞—Ç–µ–ª—å–Ω–æ–µ —Å–æ–¥–µ—Ä–∂–∏–º–æ–µ —ç—Ç–æ–≥–æ —Ñ–∞–π–ª–∞:

{"name": "Linda Richardson", "id": 107, "probation": false, "Department": "Sales" }

–ó–∞–∫–ª—é—á–µ–Ω–∏–µ

–ú–æ–¥—É–ª—å Python json –ø–æ–∑–≤–æ–ª—è–µ—Ç —á–∏—Ç–∞—Ç—å –¥–∞–Ω–Ω—ã–µ JSON –∏ —É–ø—Ä–∞–≤–ª—è—Ç—å –∏–º–∏.

–ò—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏–µ –º–æ–¥—É–ª—è json , –≤—ã –º–æ–∂–µ—Ç–µ:

–í —ç—Ç–æ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ –º—ã –∏–∑—É—á–∏–ª–∏, –∫–∞–∫ –≤—ã–ø–æ–ª–Ω—è—Ç—å –≤—Å–µ —ç—Ç–∏ –æ–ø–µ—Ä–∞—Ü–∏–∏ —Å –ø–æ–º–æ—â—å—é –º–æ–¥—É–ª—è json. –¢–µ–ø–µ—Ä—å –≤—ã –≥–æ—Ç–æ–≤—ã –Ω–∞—á–∞—Ç—å —Ä–∞–±–æ—Ç–∞—Ç—å —Å –¥–∞–Ω–Ω—ã–º–∏ JSON –≤ Python –∫–∞–∫ –ø—Ä–æ—Ñ–µ—Å—Å–∏–æ–Ω–∞–ª!


–í—ã –∑–∞–∏–Ω—Ç–µ—Ä–µ—Å–æ–≤–∞–Ω—ã –≤ —Ç–æ–º, —á—Ç–æ–±—ã –Ω–∞—É—á–∏—Ç—å—Å—è –ø—Ä–æ–≥—Ä–∞–º–º–∏—Ä–æ–≤–∞—Ç—å –Ω–∞ Python? –ó–∞–≥—Ä—É–∑–∏—Ç–µ –±–µ—Å–ø–ª–∞—Ç–Ω–æ–µ –ø—Ä–∏–ª–æ–∂–µ–Ω–∏–µ Career Karma —Å–µ–≥–æ–¥–Ω—è, —á—Ç–æ–±—ã –ø–æ–ª—É—á–∏—Ç—å –¥–æ—Å—Ç—É–ø –∫ –ª—É—á—à–∏–º —É—á–µ–±–Ω—ã–º —Ä–µ—Å—É—Ä—Å–∞–º –∏ –æ—Ç–∫—Ä—ã—Ç—å –¥–ª—è —Å–µ–±—è –æ–±—É—á–∞—é—â–∏–µ –ø—Ä–æ–≥—Ä–∞–º–º—ã, –∫–æ—Ç–æ—Ä—ã–µ –ø–æ–º–æ–≥—É—Ç –≤–∞–º –æ—Å–≤–æ–∏—Ç—å Python.

Shop

Learn programming in R: courses

$

Best Python online courses for 2022

$

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

News


Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method