@reachsg · Post #578 · 21.04.2020 г., 16:08
What are the services that will suspend operations from today till the end of Circuit Breaker? #SGUnited
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
Пребарај: #sgunited
@reachsg · Post #578 · 21.04.2020 г., 16:08
What are the services that will suspend operations from today till the end of Circuit Breaker? #SGUnited
Hashtags
@reachsg · Post #564 · 18.04.2020 г., 13:25
REACH Live! (Mandarin) Highlights #2 - How can we encourage the seniors to stay home? #SGUnited
Hashtags
@reachsg · Post #562 · 18.04.2020 г., 04:39
REACH Live! (Mandarin) Highlights #1 - Why should we wear mask whenever we go out? Let's hear from Ms Tin Pei Ling #SGUnited
Hashtags
@reachsg · Post #532 · 10.04.2020 г., 14:23
Let us all comply with the circuit breaker, and pull through it together. #SGUnited
Hashtags
@reachsg · Post #473 · 06.04.2020 г., 05:56
Tune into DPM Heng Swee Keat’s Solidarity Budget announcement later at 2PM today, where he will announce additional support for workers, businesses and households, to help tide them through this period. #SGUnited🇸🇬 📺 Catch the ‘live’ broadcast on CNA, on CNA938, and on Mediacorp’s meWATCH interactive service (www.mewatch.sg).
Hashtags
@reachsg · Post #228 · 12.03.2020 г., 13:42
[Sent by Gov.sg - 12 Mar] COVID-19 situation in S’pore - More imported cases expected as global numbers rise - More travel restrictions may be needed - If there are many cases here, may need to hospitalise only those seriously ill; those with mild symptoms to see GP, rest at home SG is NOT going to DORSCON Red — We have the situation under control Economic impact - Measures to help affected businesses, workers - Govt working on 2nd package of measures Staying #SGUnited 👩⚕ Frontline staff working hard 💪 Singaporeans’ support crucial to overcome this Everyone can do their part - Practise good personal hygiene, adopt new social norms 🧼🙌 - Maintain social distancing 👋 Watch: go.gov.sg/pmo12mar
Hashtags
@NEASingapore · Post #158 · 12.02.2021 г., 02:00
May you have good health and an OX-spicious new year! P.S. Use serving spoons and don’t double dip when having your reunion meals, let’s keep everyone safe and healthy! #SGUnited
Hashtags
@reachsg · Post #81 · 13.02.2020 г., 00:14
[Sent by Gov.sg - 13 Feb] 💪🇸🇬Helping those impacted by COVID-19: Contribute to The Courage Fund - To help those impacted by COVID-19 — patients, healthcare workers and those who need extra support www.comchest.sg/thecouragefund Go to the centralised online platform for ground-up efforts - Information on what’s needed - Information on ground-up groups and Govt-led initiatives - Details on platform soon Let’s show support for all in the healthcare and other sectors who have been working tirelessly. Look out for one another. #SGUnited
Hashtags
@NEASingapore · Post #46 · 24.04.2020 г., 04:00
Our hawkers are working hard to provide delicious food for all of us. So let’s show them our support by ordering takeaways or deliveries of our fave hawker dishes. Together we can overcome. #SGUnited
Hashtags
@URASingapore · Post #46 · 29.06.2020 г., 11:11
🏃🏻♀️ Heading out to the stadiums? Check Space Out’s (www.spaceout.gov.sg) newly-added crowd level information at SportSG’s stadiums, and sweat it out in a safe environment. We are in Phase 2 but there’s no need to rush out. Keep our guard up and use Space Out for regular updates on crowd level information in malls, supermarkets, markets post offices and stadiums across Singapore. It’s also available in all four languages, and presents less crowded options near you. Crowd-level information on more places will be added in future. 👍🏼 Let’s continue to press on, stay safe, and be #SGUnited to fight this virus together.
Hashtags
@MTISingapore · Post #4 · 05.08.2021 г., 06:19
The Safe Management Measures have been tightened from 22 July to 18 August. More information on the SMM measures for F&B and Retail and Lifestyle establishments can be found in the infographics. Let's play our part against COVID-19 #SGUnited Click here for more details: https://go.gov.sg/updated-smm-advisory
Hashtags
@mndsingapore · Post #172 · 01.05.2021 г., 02:14
It has been more than a year since COVID-19 happened. Many of us have had to adapt to new work situations and overcome the various challenges the pandemic brought with it. Today, we salute all workers, especially the frontliners who have been working extra hard to keep us safe this past year. Happy Labour Day! 💪🇸🇬 #SGUnited#SGTogether
Hashtags