TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

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

Резултати

Пронајдени 3 слични објави

Пребарај: #writer

当前筛选 #writer清除筛选

🗓🇿🇦November 20 marks the birthday of Nadine Gordimer (1923–2014), one of South Africa’s most influential English-language writers. 🏅 Recipient of the 1991 Nobel Prize in Literature. ✊ A committed member of the African National Congress and an active voice in the struggle against apartheid. ⚖️ In 1964, Gordimer helped prepare Nelson Mandela’s defense speech for the Rivonia Trial. 📖 While in prison, Mandela wrote: “I read all of Nadine Gordimer’s novels that were not banned.” ✍️ In 1987, she played a key role in establishing the Congress of South African Writers (COSAW), an important cultural platform during the final years of apartheid. 🌍 Her work remains a powerful testament to the pursuit of freedom, justice, and human dignity. 📸 Photo: Wikipedia #SouthAfrica#Literature#NobelPrize#Writer#HumanRights#History

iGaming Freelance Content Writers/Translators (Native Speakers) #remote#удаленно#iGaming#content#writer#tango We’re looking for iGaming Freelance Content Writers/Translators (Native Speakers). Our digital holding is expanding and we’re looking for native Filipino speaking translators & writers for iGaming projects. You’re a perfect fit if you have: • 1+ year of proven experience in iGaming translation or content writing • Solid understanding of iGaming terminology and cultural specifics of your region • Native fluency in #Filipino + strong English (for reading source materials) • Ability to start immediately and meet deadlines reliably What you’ll do: • Translate and localize website content (JSON format) from English • Adapt texts considering cultural/linguistic nuances • Proofread and edit content as needed We offer: • Fully remote freelance / part-time work • Competitive rates (based on skills and experience) • Interesting tasks and professional team support • No test task – we trust your portfolio Let’s connect! ⏺Apply: @IvanRecruiter ➖➖➖➖➖➖➖➖➖➖➖ 🪩 Откликнуться быстрее других ➖➖➖➖➖➖➖➖➖➖➖

Desi Memes Funny Jokes

@DESI_MEMES_Funny_Jokes · Post #5485 · 19.10.2024 г., 11:09

. . . . . #attitude#explore#tranding#reelsinstagram#viwe#relatable#exploreindia#relationshipquotes#reelkarofeelkaro#reelsolve#writer#lovereel#motivationlife#motivationalquotes#exploreing#explorepage#brokenheart#sayari#feelitreelit#reelslovers#exploreindonesia#exploreindia#100kfollowers#instagram#fashion#foryou#viralreels