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

Резултати

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

Пребарај: #bilateraltrade

当前筛选 #bilateraltrade清除筛选
Маниш Кумар 🇷🇺🇮🇳

@manishkumar_ru · Post #123 · 21.08.2025 г., 17:57

Sealing the Partnership in Moscow 🇮🇳🤝🇷🇺 We are pleased to witness a significant milestone in India-Russia relations, as EAM Dr. S. Jaishankar and Russia's Deputy Prime Minister Denis Manturov signed the Final Protocol after high-level talks in Moscow. This development further strengthens bilateral cooperation, opening doors for trade, partnerships, and joint ventures across multiple sectors. At Soltex Group, we view this as a promising step towards expanding our presence in Russia and fostering new opportunities for businesses. 📌 Interested in exploring business opportunities between India and Russia? Connect with us — we’re here to support and guide you. #IndiaRussia#TradeRelations#SoltexGroup#BusinessOpportunities#BilateralTrade#Partnership

✨️Ambassador Albert P. Khorev's Interview with “Mehran TV” Full interview available in Urdu Key points: #BilateralTrade 🔸️Over the past two years, the annual trade turnover between #Russia and #Pakistan has amounted to approximately $1 billion USD. Our governments understand that this figure does not reflect our countries' existing potential, and they are making efforts to deepen bilateral cooperation. One effective mechanism in this regard is the Intergovernmental Commission on Trade, Economic, Scientific, and Technical Cooperation, which will hold its 10th milestone meeting in November 2025 in Islamabad; 🔸️There is potential for increased fuel, petroleum products, and grain supplies from Russia to Pakistan, as well as for increased imports of Pakistani textiles, leather, and agricultural products to Russia; #JointProjects 🔸️We are considering a number of infrastructure projects, including the modernization or construction of a new Karachi Steel Mill and railway tracks, as well as the supply of Russian pharmaceutical products, with the option of joint production; 🔸️We look forward to implementing new projects in the energy and transportation sectors. Given the recent establishment of diplomatic relations between Pakistan and Armenia, we believe that a free trade agreement between Pakistan and the #EAEU is possible in the future; 🔸️The successful modernization of the Karachi Steel Mill will pave the way for more productive cooperation; #TradeInNationalCurrencies 🔸️Most of Russia's export operations with friendly countries, including #SCO member states, are conducted in national currencies. The US dollar is slowly but surely losing ground. The process of diversifying payment instruments is succeeding; #SituationInTheRegion 🔸️Russia respects the right of regional countries, including Pakistan, to choose their own foreign policy partners independently. South Asian countries' engagement with the West is an internal matter. However, we consider it inappropriate if such engagement is directed against any state or group of states; 🔸️We have noted the Americans' and their NATO allies' active efforts to return to #Afghanistan after their infamous retreat in 2021. Donald Trump's statements about the U.S.'s desire to retake control of the #Bagram Air Base and his demands that India stop purchasing Russian oil are unacceptable. They represent yet another manifestation of Western neocolonialism; 🔸️The recent SCO summit in China demonstrated the declining influence of extra-regional forces. There is a growing demand for Russian President Vladimir Putin's initiative to establish a Eurasian security system based on the principle of "regional solutions to regional problems;" #MoscowFormat 🔸️The Moscow Format Consultations bring together all of Afghanistan's neighboring countries, including Russia and Pakistan. This regional mechanism has proven its effectiveness. All its members agree that the return of U.S. and NATO military infrastructure to Afghanistan is unacceptable; #Kashmir 🔸️Pakistan and India inherited the Kashmir issue from their British colonial past. We believe that Islamabad and New Delhi should resolve their differences through political and diplomatic means. At the same time, if it receives appropriate signals from both sides, Russia is ready to contribute to improving relations between the two countries and make the necessary efforts in international forums, including the #UN. #RussiaPakistan