Как использовать переменные среды Python

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

–í–æ—Ç –≥–¥–µ –∏—Å–ø–æ–ª—å–∑—É—é—Ç—Å—è –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ —Å—Ä–µ–¥—ã!

–í —ç—Ç–æ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ –º—ã –ø–æ–≥–æ–≤–æ—Ä–∏–º –æ —Ç–æ–º, —á—Ç–æ —Ç–∞–∫–æ–µ –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ —Å—Ä–µ–¥—ã –∏ –∫–∞–∫ –∏—Ö –º–æ–∂–Ω–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å. –ú—ã —Ä–∞—Å—Å–º–æ—Ç—Ä–∏–º –ø—Ä–∏–º–µ—Ä –ø–µ—Ä–µ–º–µ–Ω–Ω—ã—Ö —Å—Ä–µ–¥—ã Python, —á—Ç–æ–±—ã –ø–æ–º–æ—á—å –≤–∞–º –Ω–∞—á–∞—Ç—å —Ä–∞–±–æ—Ç—É.

–ß—Ç–æ —Ç–∞–∫–æ–µ –ø–µ—Ä–µ–º–µ–Ω–Ω–∞—è —Å—Ä–µ–¥—ã?

–ü–µ—Ä–µ–º–µ–Ω–Ω–∞—è —Å—Ä–µ–¥—ã - —ç—Ç–æ –ø–µ—Ä–µ–º–µ–Ω–Ω–∞—è , –∑–Ω–∞—á–µ–Ω–∏–µ –∫–æ—Ç–æ—Ä–æ–π —É—Å—Ç–∞–Ω–∞–≤–ª–∏–≤–∞–µ—Ç—Å—è –≤–Ω–µ –ø—Ä–æ–≥—Ä–∞–º–º—ã.

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

–ü–æ—á–µ–º—É –∏—Å–ø–æ–ª—å–∑—É—é—Ç—Å—è –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ —Å—Ä–µ–¥—ã?

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

–ö–ª—é—á–∏ –∏–Ω—Ç–µ—Ä—Ñ–µ–π—Å–∞ –ø—Ä–∏–∫–ª–∞–¥–Ω–æ–≥–æ –ø—Ä–æ–≥—Ä–∞–º–º–∏—Ä–æ–≤–∞–Ω–∏—è (API), –∫–æ—Ç–æ—Ä—ã–µ –≤—ã –∏—Å–ø–æ–ª—å–∑—É–µ—Ç–µ –≤ –ø—Ä–æ–∏–∑–≤–æ–¥—Å—Ç–≤–µ–Ω–Ω–æ–π —Å—Ä–µ–¥–µ, –≤–µ—Ä–æ—è—Ç–Ω–æ, –Ω–µ –±—É–¥—É—Ç —Ç–∞–∫–∏–º–∏ –∂–µ, –∫–∞–∫ —Ç–µ, –∫–æ—Ç–æ—Ä—ã–µ –≤—ã –∏—Å–ø–æ–ª—å–∑—É–µ—Ç–µ –≤ –≤–∞—à –ª–æ–∫–∞–ª—å–Ω—ã–π –∫–æ–º–ø—å—é—Ç–µ—Ä. –í—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Ñ–∏–∫—Ç–∏–≤–Ω—ã–µ –¥–∞–Ω–Ω—ã–µ –Ω–∞ –≤–∞—à–µ–º –ª–æ–∫–∞–ª—å–Ω–æ–º –∫–æ–º–ø—å—é—Ç–µ—Ä–µ –ø—Ä–∏ —Å–æ–∑–¥–∞–Ω–∏–∏ –ø—Ä–∏–ª–æ–∂–µ–Ω–∏—è, –Ω–æ —ç—Ç–æ –Ω–µ –ø–æ–¥—Ö–æ–¥–∏—Ç –¥–ª—è –ø—Ä–æ–∏–∑–≤–æ–¥—Å—Ç–≤–µ–Ω–Ω–æ–π —Å—Ä–µ–¥—ã.

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

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

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

–ü–µ—Ä–µ–º–µ–Ω–Ω—ã–µ —Å—Ä–µ–¥—ã —Ç–∞–∫–∂–µ –∏—Å–ø–æ–ª—å–∑—É—é—Ç—Å—è –¥–ª—è –≤ —Ü–µ–ª—è—Ö –±–µ–∑–æ–ø–∞—Å–Ω–æ—Å—Ç–∏. –ù–∞–ø–∏—Å–∞–Ω–∏–µ –∫–ª—é—á–µ–π API –∏ –∑–Ω–∞—á–µ–Ω–∏–π –∫–æ–Ω—Ñ–∏–≥—É—Ä–∞—Ü–∏–∏ –≤–Ω—É—Ç—Ä–∏ –æ—Å–Ω–æ–≤–Ω–æ–π –ø—Ä–æ–≥—Ä–∞–º–º—ã –º–æ–∂–µ—Ç –±—ã—Ç—å —Ä–∏—Å–∫–æ–≤–∞–Ω–Ω—ã–º, –ø–æ—Ç–æ–º—É —á—Ç–æ –∫–∞–∂–¥—ã–π —É—á–∞—Å—Ç–Ω–∏–∫ –ø—Ä–æ–µ–∫—Ç–∞ –º–æ–∂–µ—Ç –∏—Ö –≤–∏–¥–µ—Ç—å. –ï—Å–ª–∏ –≤—ã —É–∫–∞–∂–µ—Ç–µ –∑–Ω–∞—á–µ–Ω–∏–µ –≤–Ω—É—Ç—Ä–∏ –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π —Å—Ä–µ–¥—ã, —Ç–æ–ª—å–∫–æ –≤–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –∏ —Ä–∞–∑—Ä–∞–±–æ—Ç—á–∏–∫, —É—Å—Ç–∞–Ω–æ–≤–∏–≤—à–∏–π —ç—Ç—É –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é, —Å–º–æ–≥—É—Ç –ø–æ–ª—É—á–∏—Ç—å –∫ –Ω–µ–º—É –¥–æ—Å—Ç—É–ø.

–ö–∞–∫ —É—Å—Ç–∞–Ω–æ–≤–∏—Ç—å –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é —Å—Ä–µ–¥—ã

–ù–∞—á–Ω–µ–º —Å —Å–æ–∑–¥–∞–Ω–∏—è –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π —Å—Ä–µ–¥—ã. –ü–µ—Ä–µ–º–µ–Ω–Ω–∞—è —Å—Ä–µ–¥—ã –±—É–¥–µ—Ç —Å—É—â–µ—Å—Ç–≤–æ–≤–∞—Ç—å —Ç–æ–ª—å–∫–æ –¥–æ –∑–∞–≤–µ—Ä—à–µ–Ω–∏—è —Å–µ–∞–Ω—Å–∞ Python. –≠—Ç–æ –æ–∑–Ω–∞—á–∞–µ—Ç, —á—Ç–æ –∫–∞–∫ —Ç–æ–ª—å–∫–æ –≤—ã –∑–∞–∫—Ä–æ–π—Ç–µ –∏–Ω—Ç–µ—Ä–ø—Ä–µ—Ç–∞—Ç–æ—Ä Python, –ø–µ—Ä–µ–º–µ–Ω–Ω–∞—è –±—É–¥–µ—Ç —Å–±—Ä–æ—à–µ–Ω–∞ –≤ –≤–∞—à–∏—Ö —Å—Ü–µ–Ω–∞—Ä–∏—è—Ö Python.

–ú—ã —Å–æ–∑–¥–∞–µ–º –ø—Ä–∏–ª–æ–∂–µ–Ω–∏–µ, –∏—Å–ø–æ–ª—å–∑—É—é—â–µ–µ Airtable API. –ú—ã —Å–æ–±–∏—Ä–∞–µ–º—Å—è –æ–ø—É–±–ª–∏–∫–æ–≤–∞—Ç—å –Ω–∞—à –∫–æ–¥ –Ω–∞ GitHub, –ø–æ—ç—Ç–æ–º—É –º—ã –Ω–µ " –Ø –Ω–µ —Ö–æ—á—É, —á—Ç–æ–±—ã –Ω–∞—à –∫–ª—é—á API –±—ã–ª –ø–æ–∫–∞–∑–∞–Ω –ø—É–±–ª–∏–∫–µ. –ß—Ç–æ–±—ã –¥–æ–±–∞–≤–∏—Ç—å –Ω–∞—à –∫–ª—é—á API –≤ –Ω–∞—à –∫–æ–¥, –Ω–µ —Ä–∞—Å–∫—Ä—ã–≤–∞—è –µ–≥–æ –ø—É–±–ª–∏—á–Ω–æ, –º—ã —Å–æ–±–∏—Ä–∞–µ–º—Å—è –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é —Å—Ä–µ–¥—ã.

–ü–µ—Ä–≤—ã–º —à–∞–≥–æ–º —è–≤–ª—è–µ—Ç—Å—è –∏–º–ø–æ—Ä—Ç –±–∏–±–ª–∏–æ—Ç–µ–∫–∞ –û–°:

import os

–≠—Ç–∞ –±–∏–±–ª–∏–æ—Ç–µ–∫–∞ —Å–æ–¥–µ—Ä–∂–∏—Ç –∫–æ–¥ –¥–ª—è —Ä–∞–±–æ—Ç—ã —Å –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–º–∏ —Å—Ä–µ–¥—ã Python. –î–∞–ª–µ–µ –º—ã —Å–æ–±–∏—Ä–∞–µ–º—Å—è –¥–ª—è —É—Å—Ç–∞–Ω–æ–≤–∫–∏ –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π —Å—Ä–µ–¥—ã:

Os.environ [" AIRTABLE_KEY "] = " –í–ê–® _API_KEY "

–≠—Ç–æ—Ç –∫–æ–¥ —É—Å—Ç–∞–Ω–∞–≤–ª–∏–≤–∞–µ—Ç –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é —Å –∏–º–µ–Ω–µ–º AIRTABLE_KEY. –ï–≥–æ –∑–Ω–∞—á–µ–Ω–∏–µ - YOUR_API_KEY. –ù–∞–∑–Ω–∞—á–µ–Ω–∏–µ –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π —Å—Ä–µ–¥—ã —Ä–∞–±–æ—Ç–∞–µ—Ç –∞–Ω–∞–ª–æ–≥–∏—á–Ω–æ —Ç–æ–º—É, –∫–∞–∫ –≤—ã –º–µ–Ω—è–µ—Ç–µ –∑–Ω–∞—á–µ–Ω–∏—è –≤ —Å–ª–æ–≤–∞—Ä–µ .

–í–∞–º –Ω–µ–æ–±—Ö–æ–¥–∏–º–æ —É–∫–∞–∑–∞—Ç—å –∏–º—è –ø–µ—Ä–µ–º–µ–Ω–Ω–∞—è, –∫–æ—Ç–æ—Ä—É—é –≤—ã —Ö–æ—Ç–∏—Ç–µ —É—Å—Ç–∞–Ω–æ–≤–∏—Ç—å –∏–ª–∏ –∏–∑–º–µ–Ω–∏—Ç—å, –∑–∞ –∫–æ—Ç–æ—Ä–æ–π —Å–ª–µ–¥—É–µ—Ç –∑–Ω–∞–∫ —Ä–∞–≤–µ–Ω—Å—Ç–≤–∞, –∑–∞—Ç–µ–º –∑–Ω–∞—á–µ–Ω–∏–µ, –∫–æ—Ç–æ—Ä–æ–µ –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø—Ä–∏—Å–≤–æ–∏—Ç—å –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π.

–¢–æ—Ç –∂–µ —Å–∏–Ω—Ç–∞–∫—Å–∏—Å –º–æ–∂–Ω–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –¥–ª—è –∏–∑–º–µ–Ω–µ–Ω–∏—è –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π —Å—Ä–µ–¥—ã:

os.environ [" AIRTABLE_KEY "] = " YOUR_API_KEY_2 "

–ó–Ω–∞—á–µ–Ω–∏–µ –Ω–∞—à–µ–≥–æ –∫–ª—é—á–∞ API –∏–∑–º–µ–Ω–µ–Ω–æ –Ω–∞ YOUR_API_KEY_2.

–ö–∞–∫ –ø–æ–ª—É—á–∏—Ç—å –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é —Å—Ä–µ–¥—ã

–ú—ã —Ç–æ–ª—å–∫–æ —á—Ç–æ —É—Å—Ç–∞–Ω–æ–≤–∏–ª–∏ –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é —Å—Ä–µ–¥—ã. –í–µ—Ä–æ—è—Ç–Ω–æ, —É –≤–∞—Å –≤–æ–∑–Ω–∏–∫–∞–µ—Ç –≤–æ–ø—Ä–æ—Å: –∫–∞–∫ –º—ã –º–æ–∂–µ–º –ø–æ–ª—É—á–∏—Ç—å –∑–Ω–∞—á–µ–Ω–∏–µ? –í–æ—Ç –≥–¥–µ –º—ã –º–æ–∂–µ–º –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –º–µ—Ç–æ–¥ os.environ.get ().

–ü–æ–∑–≤–æ–ª—å—Ç–µ " s –ø–æ–ª—É—á–∏—Ç—å –∑–Ω–∞—á–µ–Ω–∏–µ –Ω–∞—à–µ–≥–æ AIRTABLE_KEY –ø–µ—Ä–µ–º–µ–Ω–Ω–∞—è:

–ú—ã –∑–∞—è–≤–∏–ª–∏, —á—Ç–æ —Ö–æ—Ç–∏–º –ø–æ–ª—É—á–∏—Ç—å –∑–Ω–∞—á–µ–Ω–∏–µ –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π —Å—Ä–µ–¥—ã AIRTABLE_KEY. –ú—ã –ø—Ä–∏—Å–≤–∞–∏–≤–∞–µ–º —ç—Ç–æ –∑–Ω–∞—á–µ–Ω–∏–µ –Ω–æ–≤–æ–π –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π —Å –∏–º–µ–Ω–µ–º api_key, –∞ –∑–∞—Ç–µ–º –≤—ã–≤–æ–¥–∏–º –µ–≥–æ –Ω–∞ –∫–æ–Ω—Å–æ–ª—å.

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

–í—ã –º–æ–∂–µ—Ç–µ –ø–æ–ª—É—á–∏—Ç—å —Å–ø–∏—Å–æ–∫ –≤—Å–µ—Ö —É—Å—Ç–∞–Ω–æ–≤–ª–µ–Ω–Ω—ã—Ö –≤–∞–º–∏ –ø–µ—Ä–µ–º–µ–Ω–Ω—ã—Ö —Å—Ä–µ–¥—ã, —Ä–∞—Å–ø–µ—á–∞—Ç–∞–≤ —Å–æ–¥–µ—Ä–∂–∏–º–æ–µ os.environ –Ω–∞ –∫–æ–Ω—Å–æ–ª—å:

print (os.environ)

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

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

< p> –í–Ω—É—Ç—Ä–∏ Python —É—Å—Ç–∞–Ω–æ–≤–ª–µ–Ω —Ä—è–¥ –ø–µ—Ä–µ–º–µ–Ω–Ω—ã—Ö —Å—Ä–µ–¥—ã –ø–æ —É–º–æ–ª—á–∞–Ω–∏—é. –≠—Ç–æ –æ–∑–Ω–∞—á–∞–µ—Ç, —á—Ç–æ –ø–µ—á–∞—Ç—å –≤—Å–µ—Ö –ø–µ—Ä–µ–º–µ–Ω–Ω—ã—Ö —Å—Ä–µ–¥—ã, —É—Å—Ç–∞–Ω–æ–≤–ª–µ–Ω–Ω—ã—Ö –≤ –ø—Ä–æ–≥—Ä–∞–º–º–µ Python, –º–æ–∂–µ—Ç –≤–µ—Ä–Ω—É—Ç—å –¥–ª–∏–Ω–Ω—ã–π —Å–ø–∏—Å–æ–∫.

–ö–∞–∫ —É–¥–∞–ª–∏—Ç—å –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é —Å—Ä–µ–¥—ã

–í—ã –º–æ–∂–µ—Ç–µ —É–¥–∞–ª–∏—Ç—å –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ —Å—Ä–µ–¥—ã –≤–Ω—É—Ç—Ä–∏ –ø—Ä–æ–µ–∫—Ç–∞ Python. –≠—Ç–æ –º–æ–∂–Ω–æ —Å–¥–µ–ª–∞—Ç—å —Å –ø–æ–º–æ—â—å—é –º–µ—Ç–æ–¥–∞ os.environ.pop (). –î–∞–≤–∞–π—Ç–µ —É–¥–∞–ª–∏–º –Ω–∞—à—É —Å—Ä–µ–¥—É AIRTABLE_KEY –ø–µ—Ä–µ–º–µ–Ω–Ω–∞—è:

os.environ.pop (" AIRTABLE_KEY ")

–≠—Ç–æ—Ç –∫–æ–¥ —É–¥–∞–ª—è–µ—Ç AIRTABLE_KEY –ø–µ—Ä–µ–º–µ–Ω–Ω–∞—è —Å—Ä–µ–¥—ã.

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

–í–æ—Ç –≥–¥–µ –ø—Ä–∏–≥–æ–¥–∏—Ç—Å—è –º–µ—Ç–æ–¥ clear (). –î–∞–≤–∞–π—Ç–µ —É–¥–∞–ª–∏–º –≤—Å–µ –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ —Å—Ä–µ–¥—ã –≤ –Ω–∞—à–µ–º —Å–µ–∞–Ω—Å–µ:

–≠—Ç–æ—Ç –∫–æ–¥ –æ—á–∏—â–∞–µ—Ç –∑–Ω–∞—á–µ–Ω–∏—è –≤—Å–µ—Ö –ø–µ—Ä–µ–º–µ–Ω–Ω—ã—Ö —Å—Ä–µ–¥—ã. –ó–∞—Ç–µ–º –æ–Ω –ø–µ—á–∞—Ç–∞–µ—Ç —Å–ø–∏—Å–æ–∫ –≤—Å–µ—Ö –ø–µ—Ä–µ–º–µ–Ω–Ω—ã—Ö —Å—Ä–µ–¥—ã –≤ –Ω–∞—à–µ–º —Å–µ–∞–Ω—Å–µ:

{}

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

–í–∞–º —Å–ª–µ–¥—É–µ—Ç –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –º–µ—Ç–æ–¥ clear () —Ç–æ–ª—å–∫–æ –≤ —Ç–æ–º —Å–ª—É—á–∞–µ, –µ—Å–ª–∏ –≤—ã —É–≤–µ—Ä–µ–Ω—ã, —á—Ç–æ –≤–∞–º –Ω–µ –Ω—É–∂–Ω—ã –Ω–∏–∫–∞–∫–∏–µ –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ —Å—Ä–µ–¥—ã –≤ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –±–æ–ª—å—à–µ. –ò—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏–µ –º–µ—Ç–æ–¥–∞ pop () –ø—Ä–µ–¥–ø–æ—á—Ç–∏—Ç–µ–ª—å–Ω–µ–µ, –ø–æ—Å–∫–æ–ª—å–∫—É –æ–Ω –±–æ–ª–µ–µ –∫–æ–Ω–∫—Ä–µ—Ç–µ–Ω.

–ö–∞–∫ —É—Å—Ç–∞–Ω–æ–≤–∏—Ç—å –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ —Å—Ä–µ–¥—ã —Å –ø–æ–º–æ—â—å—é Dotenv

–ë–∏–±–ª–∏–æ—Ç–µ–∫–∞ dotenv –ø—Ä–µ–¥–æ—Å—Ç–∞–≤–ª—è–µ—Ç —Ä—è–¥ –ø–æ–ª–µ–∑–Ω—ã—Ö —Ñ—É–Ω–∫—Ü–∏–∏ –¥–ª—è —É–ø—Ä–∞–≤–ª–µ–Ω–∏—è –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–º–∏ —Å—Ä–µ–¥—ã.

–í —á–∞—Å—Ç–Ω–æ—Å—Ç–∏, dotenv –ø–æ–∑–≤–æ–ª—è–µ—Ç –≤–∞–º —á–∏—Ç–∞—Ç—å –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ —Å—Ä–µ–¥—ã –∏–∑ —Ñ–∞–π–ª–∞ . –≠—Ç–æ –æ–∑–Ω–∞—á–∞–µ—Ç, —á—Ç–æ –≤–∞–º –Ω–µ –Ω—É–∂–Ω–æ –æ–±—ä—è–≤–ª—è—Ç—å –∏—Ö –≤–Ω—É—Ç—Ä–∏ –æ–±–æ–ª–æ—á–∫–∏ Python.

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

–î–ª—è —Ä–∞–±–æ—Ç—ã —Å –ø–∞–∫–µ—Ç–æ–º dotenv –µ–≥–æ –Ω–µ–æ–±—Ö–æ–¥–∏–º–æ —É—Å—Ç–∞–Ω–æ–≤–∏—Ç—å. –≠—Ç–æ –º–æ–∂–Ω–æ —Å–¥–µ–ª–∞—Ç—å —Å –ø–æ–º–æ—â—å—é easy_install –∏–ª–∏ pip.

–ù–∞—á–Ω–µ–º —Å –æ–ø—Ä–µ–¥–µ–ª–µ–Ω–∏–µ –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π —Å—Ä–µ–¥—ã. –î–ª—è —ç—Ç–æ–≥–æ –º—ã —Å–æ–±–∏—Ä–∞–µ–º—Å—è —Å–æ–∑–¥–∞—Ç—å —Ñ–∞–π–ª —Å –∏–º–µ–Ω–µ–º .env. –ú—ã –º–æ–∂–µ–º —Å–æ–∑–¥–∞—Ç—å —ç—Ç–æ—Ç —Ñ–∞–π–ª –∏–∑ –∫–æ–º–∞–Ω–¥–Ω–æ–π —Å—Ç—Ä–æ–∫–∏, –∏—Å–ø–æ–ª—å–∑—É—è –∫–æ–º–∞–Ω–¥—É touch:

touch .env

–û—Ç–∫—Ä–æ–π—Ç–µ —Ñ–∞–π–ª .env –∏ –¥–æ–±–∞–≤—å—Ç–µ —Å–ª–µ–¥—É—é—â–µ–µ —Å–æ–¥–µ—Ä–∂–∏–º–æ–µ:

AIRTABLE_KEY = YOUR_API_KEY_3

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

–ó–∞—Ç–µ–º –º—ã —Å–æ–±–∏—Ä–∞–µ–º—Å—è –∑–∞–≥—Ä—É–∑–∏—Ç—å –Ω–∞—à–∏ –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ –≤ —Ñ–∞–π–ª:

–≠—Ç–æ—Ç –∫–æ–¥ –∏–º–ø–æ—Ä—Ç–∏—Ä—É–µ—Ç –º–µ—Ç–æ–¥ load_dotenv () –∏–∑ –±–∏–±–ª–∏–æ—Ç–µ–∫–∏ dotenv –∏ –≤—ã–ø–æ–ª–Ω—è–µ—Ç –≠—Ç–æ. –≠—Ç–æ –ø—Ä–æ—á–∏—Ç–∞–µ—Ç –≤—Å–µ –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ –∏–∑ –Ω–∞—à–µ–≥–æ —Ñ–∞–π–ª–∞ .env –≤ –Ω–∞—à—É —Å—Ä–µ–¥—É.

–ó–∞—Ç–µ–º –¥–∞–≤–∞–π—Ç–µ –ø–æ–ø—Ä–æ–±—É–µ–º –ø–æ–ª—É—á–∏—Ç—å –Ω–∞—à—É –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é —Å –ø–æ–º–æ—â—å—é –±–∏–±–ª–∏–æ—Ç–µ–∫–∏ os:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç: YOUR_API_KEY_3. –ù–∞—à –∫–ª—é—á API –±—ã–ª —É—Å—Ç–∞–Ω–æ–≤–ª–µ–Ω –≤–Ω—É—Ç—Ä–∏ –Ω–∞—à–µ–≥–æ —Ñ–∞–π–ª–∞ .env. –ú–µ—Ç–æ–¥ load_dotenv () –∑–∞–≥—Ä—É–∑–∏–ª –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ —Å—Ä–µ–¥—ã –∏ —Å–¥–µ–ª–∞–ª –∏—Ö –¥–æ—Å—Ç—É–ø–Ω—ã–º–∏ —Å –ø–æ–º–æ—â—å—é –º–µ—Ç–æ–¥–∞ os.environ.

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

–ü–µ—Ä–µ–º–µ–Ω–Ω—ã–µ —Å—Ä–µ–¥—ã - —ç—Ç–æ –ø—Ä–µ–¥–æ–ø—Ä–µ–¥–µ–ª–µ–Ω–Ω—ã–µ –∑–Ω–∞—á–µ–Ω–∏—è, –∫–æ—Ç–æ—Ä—ã–µ –∏—Å–ø–æ–ª—å–∑—É—é—Ç—Å—è –¥–ª—è –Ω–∞—Å—Ç—Ä–æ–π–∫–∏ –∑–Ω–∞—á–µ–Ω–∏—è –≤–Ω–µ –ø—Ä–æ–≥—Ä–∞–º–º—ã. –û–±—ã—á–Ω–æ –æ–Ω–∏ –∏—Å–ø–æ–ª—å–∑—É—é—Ç—Å—è –¥–ª—è –Ω–∞—Å—Ç—Ä–æ–π–∫–∏ —Ä–∞–∑–ª–∏—á–Ω—ã—Ö —Å—Ä–µ–¥, –æ—Ç—Å—é–¥–∞ –∏ –∏—Ö –Ω–∞–∑–≤–∞–Ω–∏–µ. & Nbsp;

–ü–µ—Ä–µ–º–µ–Ω–Ω—ã–µ —Å—Ä–µ–¥—ã - —ç—Ç–æ –±–µ–∑–æ–ø–∞—Å–Ω—ã–π —Å–ø–æ—Å–æ–± —É—Å—Ç–∞–Ω–æ–≤–∫–∏ —Å–µ–∫—Ä–µ—Ç–Ω—ã—Ö –∑–Ω–∞—á–µ–Ω–∏–π. –í—ã –Ω–µ –∑–∞—Ö–æ—Ç–∏—Ç–µ –Ω–∞–ø—Ä—è–º—É—é –¥–æ–±–∞–≤–ª—è—Ç—å –∫–ª—é—á API –≤ –∫–æ–¥ —Å–≤–æ–µ–≥–æ –ø—Ä–∏–ª–æ–∂–µ–Ω–∏—è, –ø–æ—Ç–æ–º—É —á—Ç–æ –æ–Ω –±—É–¥–µ—Ç –¥–æ—Å—Ç—É–ø–µ–Ω –¥–ª—è —á—Ç–µ–Ω–∏—è –≤—Å–µ–º, –∫—Ç–æ –≤–∏–¥–∏—Ç –≤–∞—à–µ –ø—Ä–∏–ª–æ–∂–µ–Ω–∏–µ. –í—ã –º–æ–∂–µ—Ç–µ —É—Å—Ç–∞–Ω–æ–≤–∏—Ç—å –µ–≥–æ –≤ –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π —Å—Ä–µ–¥—ã, —á—Ç–æ–±—ã –∑–Ω–∞—á–µ–Ω–∏–µ –º–æ–≥–ª–∏ –≤–∏–¥–µ—Ç—å —Ç–æ–ª—å–∫–æ –≤—ã –∏ –≤–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞.

–¢–µ–ø–µ—Ä—å –≤—ã –≥–æ—Ç–æ–≤—ã –Ω–∞—á–∞—Ç—å —Ä–∞–±–æ—Ç–∞—Ç—å —Å –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–º–∏ —Å—Ä–µ–¥—ã –≤ –∫–æ–¥–µ 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