@QuietWorld · Post #6814 · 29.10.2019 г., 06:30
Correction does much, but encouragement does more. #kindness@quietworld🍃
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #303 · 27 дек.
Наверняка вы замечали, что в Python есть удобная функция для получения переменной окружения os.getenv(NAME) И её "сестра" для создания или изменения переменных окружения os.putenv(NAME, VALUE) Но почему-то putenv() не работает как должно. Энвайромент не обновляется! os.putenv('MYVAR', '1') print(os.getenv('MYVAR')) ... и ничего 😴 Почему так? На самом деле энвайромент обновляется, но это значение не добавляется в словарь os.environ. Откройте исходник функции os.getenv(). Это просто шорткат для os.environ.get() В то время как putenv() это built-in С-функция. Словарь os.environ (или точней класс из MutableMapping) создаётся из энвайромента в момент инициализации. Функция putenv() самостоятельно его не изменяет. В тоже время, когда вы создаёте или изменяете ключ в os.environ, автоматически вызывается putenv() в методе __setitem__(). То есть, технически putenv() всё делает верно, но в os.environ это не отражается. Можно проверить так: >>> os.putenv('MYVAR', '123') >>> os.system('python -c "import os;print(os.getenv(\'MYVAR\'))"') 123 Я объявил переменную в текущем процессе и вызвал дочерний процесс, который её унаследовал и получил в составе os.environ. Аналогично при удалении переменной вызывается еще одна built-in функция unsetenv(), удаляющая переменную из системы. Итого ▫️ Удобней всего явно обновлять переменные через os.environ ▫️ Есть способ неявно создать/удалить переменную через putenv/unsetenv, что не повлияет на os.environ но изменит энвайромент и передаст изменения сабпроцессам. Но так лучше не делать! ▫️os.environ это просто обертка для built-in функций putenv() и unsetenv(). #basic
Hashtags
Пребарај: #kindness
@QuietWorld · Post #6814 · 29.10.2019 г., 06:30
Correction does much, but encouragement does more. #kindness@quietworld🍃
Hashtags
@QuietWorld · Post #6808 · 28.10.2019 г., 06:30
He who helps early helps twice. #kindness#life @quietworld🍃
@learnRCRussian · Post #5825 · 13.12.2025 г., 15:00
Служба спасения сов! Owl Rescue Service! 🦉Our fighters are rescuing an owl that got tangled in the fiber-optic cable from an FPV drone. • Сова (совы) (femin.noun) [sa-va (so-vy)] An owl(s) #news #kindness 😎RCR | Support | Boost
@learnRCRussian · Post #5821 · 12.12.2025 г., 13:00
Sometimes the world seems very difficult and complicated, doesn't it? 😽It is so difficult to remain kind and humane in our time, the harder our life is, the more pleased we are with videos where people support and understand each other, where a kind joke warms our hearts and makes our world brighter! 😽Yes, we are busy with our own affairs, burdened with problems, family events. We forget about the power of human kindness. A young girl, on her first day at work, is very worried. Every plate feels like a test, every look from the customer feels like a judgment. But instead of impatience, she is greeted with smiles. Instead of irritation, there are encouraging shouts and friendly hugs. The guests, as if sensing her vulnerability, choose sympathy. They thank and cheer her up. 😽This is a deep truth. Our strength is not in perfection, but in kindness. We offer kindness to others and choose it in ourselves. Video: Новый мир #kindness #brief_and_interesting #Russian_culture 😎RCR | Support | Boost
@QuietWorld · Post #7202 · 24.02.2020 г., 08:38
#life#love#kindness @quietworld🍃
@QuietWorld · Post #6779 · 23.10.2019 г., 23:30
🔖“What we have done for ourselves alone; dies with us. What we have done for others and the world; remains and is immortal.” · Albert Pike · #life#kindness#truth @quietworld🍃
@QuietWorld · Post #7625 · 07.10.2020 г., 02:01
#life#kindness#inspiration @quietworld🍃
Hashtags
@googlefactss · Post #40077 · 13.11.2025 г., 03:00
World Kindness Day, from the World Kindness Movement, is a universal awareness day about promoting the importance of being kind to each other, to yourself, and to the world, and is celebrated on the 13th of November every year. Celebrate by being kind online too. [Source] @googlefactss #Kindness#BeKind
@QuietWorld · Post #6748 · 19.10.2019 г., 13:00
Happiness is not so much in having as in sharing; We make a living by what we get, but we make a life by what we give. – Norman M. #kindness#happiness#life @quietworld🍃
Hashtags
@QuietWorld · Post #7764 · 24.03.2021 г., 22:24
#wisdom#kindness#truth @quietworld🍃
@QuietWorld · Post #6811 · 28.10.2019 г., 13:01
We love those people who give with humility, or who accept with ease. #kindness#gratitude @quietworld🍃
Hashtags
@QuietWorld · Post #7694 · 24.11.2020 г., 00:54
#love#kindness#life#truth @quietworld🍃