Наверняка вы замечали, что в 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
#Dutch court sentences #Eritrea human trafficker to 20 years
A Dutch court on Tuesday sentenced an Eritrean man to 20 years in prison for operating a human trafficking ring in which migrants were tortured and their families extorted.
The court said the man, identified as Amanuel #Walid, had treated migrants "without any humanity" as they were transported from Eritrea to #Europe via #Libya.
"Your only aim was to earn as much money as possible from people who were looking for a better future," presiding judge Rene Melaard told Walid.
The court in the northern Dutch city of #Zwolle heard how gang members tortured victims while on the phone to their families in the Netherlands, demanding payments to make the abuse stop. Only once family members had transferred money were the victims put on rickety boats for the perilous trip across the Mediterranean Sea. Many drowned in the crossing.
https://www.facebook.com/AddisstandardEng/posts/pfbid0e9YqCpyLghyEouyA911hTeebioBPf4mTh4fVeBBchU9xr53T5qZURCXU8qW5ZQisl
Переводчики-редакторы со знанием иностранных языков
#удаленно#вакансия#crypto#tango
Katz Technologies LLC создаёт WEB3-экосистему (криптокошелёк, DEX, Memepad, Explorer) и ищем профессионального переводчика-редактора для проверки ИИ-переводов сайта и долгосрочного сотрудничества.
Не важны дипломы и громкие компании. Главное - чувство языка, ответственности и понимание crypto-контекста. Вы сразу видите искажения смысла, ошибки в терминах и роботизированный перевод, умеете быстро и точно доводить машинный текст до профессионального уровня. Важно чувствовать тон продукта, которому пользователь доверит деньги.
Мы предлагаем:
- Долгосрочный проект и сильный кейс в портфолио
- Удалённую работу и гибкий график
- Возможность влиять на продукт с нуля
- Бонусы за результат
Задачи:
- Проверка ИИ-перевода сайта (10+ страниц, ~5 000 знаков каждая)
- Контроль смысла и терминологии (Tier-1 приоритет)
- Исправление ошибок, кальки и неестественных формулировок
- Работа с готовым переводом (без переписывания с нуля)
Языки (один или несколько):
#German, #Swedish, #Polish, #Dutch, #French, #Turkish, #Spanish, #Portuguese
Обязательно:
- Уровень: C1+
- Умение быстро вносить точечные правки
Приветствуется:
Опыт в IT / crypto / fintech
Как откликнуться:
В ТГ: https://t.me/shillbert
Укажите язык(и), опыт и примеры проектов (если есть).
⏺Откликнуться: https://t.me/shillbert
➖➖➖➖➖➖➖➖➖➖➖
🪩 Откликнуться быстрее других
➖➖➖➖➖➖➖➖➖➖➖
🇮🇱🇳🇱#Dutch police confirm the #Israeli#football#hooligans started the violence in #Amsterdam
• Israeli hooligans march through the city centre shouting out racist chants, mocking the victims of Israeli #genocide in #Gaza
• Hooligans tear down #Palestine flags and burn them
• Hooligans ignore the minute of silence for the victims of #Valencia floods
• Hooligans attack Arab-looking Taxi driver
• Hooligans get attacked after the game. Taxi drivers join in.
• Western Media create usual (fake) "Isreali victim" myth and the usual fake "#antiSemitism" claims follow.
Jerusalem Post of Nov 5, states: "#Mossad agents among the Israeli hooligans" (also active-duty #IDF soldiers.)
https://archive.is/48eVN
The whole thing is #ZioNazi Theatre, created to put political pressure on the Dutch because
in June this year:
THE #NETHERLANDS STOPPED SUPPLYING #F35 SPARE-PARTS TO ISRAEL.
TWITTER FULLY EMBRACES "THE DARK SIDE"!
If you are a #Twitter/#X "Creator" your #UserData/ID will end up in the hands of #Mossad
#AU10TIX, the company that X/Twitter uses to verify its user's ID, is an Israeli company founded by members of Israeli intelligence units #ShinBet and #Unit8200.
The CEO, Ron #Atzmon, was a member of Israel's #CyberIntelligence unit 8200. His father was once the treasurer of the #Likud, #Netanyahu's party.
AU10TIX was founded in 2002 as the technology arm of a #Dutch firm called "#ICTSInternational".
ICTS international was established in 1982 ALSO by former members of Israeli intelligence unit Shin Bet.
This is an extreme security risk.
Not only will regular creators have to give their ID to a company with deep ties to Israeli intelligence, but PRO-#PALESTINIAN creators will also have to do the same.