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

Резултати

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

Пребарај: #jungkook

当前筛选 #jungkook清除筛选
Bts.bighitofficial

@OUR_7_PRINCES · Post #115040 · 03.08.2025 г., 22:58

According to @/mkgenie, the president of Michael Jackson's Chinese fanclub, and that had access to the list of recording artists of the MJ tribute project in 2023, Jungkook was one of the renowned singers that would get to sing one of the 10 never-released song written by Michael Jackson along with Bruno Mars, Doja Cat and Sza! #JUNGKOOK •@OUR_7_PRINCES•

Hashtags

Bts.bighitofficial

@OUR_7_PRINCES · Post #114386 · 03.07.2025 г., 02:12

“Yes, Love him! Incredible! His dancing, singing, songs, incredible machine. I love that dude, like he’s incredible” — Omar Rudberg, a Venezuelan-Swedish singer and actor, about #Jungkook #JUNGKOOK •@OUR_7_PRINCES•

Hashtags

Bts.bighitofficial

@OUR_7_PRINCES · Post #115323 · 26.11.2025 г., 00:22

GameSpot, a major American website providing news & reviews about video games, wrote an article about #Jungkook “BTS's Jungkook Is A Streamer Now, Here Are The Games He's Played So Far” https://www.gamespot.com/gallery/btss-jungkook-is-a-streamer-now-here-are-the-games-hes-played-so-far/2900-7286/ #INFO •@OUR_7_PRINCES•

Bts.bighitofficial

@OUR_7_PRINCES · Post #115206 · 13.08.2025 г., 15:27

Famous actor Manny Jacinto said #Jungkook was his bias in a recent interview for Cosmopolitan Q: Recently, a photo of you at a j-hope concert made the internet rounds. Who is your BTS bias? 🗣️ “Jungkook. I was a dancer, and I have this theory. Jungkook apparently trained in Los Angeles when he was younger, and I think we almost crossed paths and trained in the same studio around the same time. I mean, he is, like, eight years younger than me, but I saw videos and pictures of him training at the same studio. And I was like, wait, when was this? And this was around the same time, like, summer of 2012, 2011. I think he’s one of the best dancers on the team. But I also just dig his music.” #INFO •@OUR_7_PRINCES•

123•••89
ПретходнаСтраница 1 од 9Следна