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

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #201 · 13 јан.

Мы уже знаем, что на текущую сессию интерпретатора изменение PYTHONPATH никак не повлияет. Но если вы запустите дочерний процесс, то он унаследует окружение текущего процесса, а значит и изменения в любых переменных будут на него влиять. Вот небольшой пример: Объявляем переменную user@host:~$ export PYTHONPATH=/path1 Запускаем интерпретатор user@host:~$ python3 Проверим что в sys.path >>> import sys >>> print(sys.path) ['', '/path1', '/usr/lib/...', ...] Добавляем что-то в переменную >>> import os >>> os.emviron['PYTHONPATH'] = '/path1:/path2' >>> print(sys.path) ['', '/path1', '/usr/lib/...', ...] Изменений нет. Но давайте запустим дочерний процесс и посмотрим там >>> os.system('python3') # теперь мы находимся в другом процессе >>> import sys >>> print(sys.path) ['', '/path1', '/path2', '/usr/lib/...', ...] Тоже самое будет и с subprocess, так как по умолчанию текущее окружение тоже наследуется. >>> import subprocess >>> subprocess.call(['python3', '-c', 'import sys;print(sys.path)']) ['', '/path1', '/path2', '/usr/lib/...', ...] ______________________ Лучшей практикой является передача энвайронмента явно через аргумент env! import subprocess subprocess.call(cmd, env={'PYTHONPATH': '...'}) Это поможет точно понимать какое окружение будет у запускаемого процесса и при этом не изменять окружение текущего процесса. #basic

Hashtags

Резултати

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

Пребарај: #odaily

当前筛选 #odaily清除筛选
Crypto M - Crypto News

@CryptoM · Post #64935 · 10.04.2026 г., 10:55

🚀 Strategy's Stretch Nears Significant Bitcoin Acquisition Strategy's Stretch (STRC) is reportedly close to acquiring a substantial amount of Bitcoin this week. According to Odaily, the company is estimated to have raised enough funds to purchase 8,000 BTC. By the end of the week, STRC may hold a total of 10,000 BTC. #Strategy#Bitcoin#BTC#Acquisition#STRC#Odaily

Crypto M - Crypto News

@CryptoM · Post #64795 · 10.04.2026 г., 00:15

🚀 Kremlin Announces Easter Truce for April 2026 The Kremlin has announced a ceasefire to take place from April 11, 2026, at 16:00 until the end of April 12, 2026. According to Odaily, this truce is set to coincide with the Easter holiday. Further details about the ceasefire have not been disclosed. #Kremlin#EasterTruce#Ceasefire#April2026#Odaily#EasterHoliday

Crypto M - Crypto News

@CryptoM · Post #64518 · 09.04.2026 г., 05:44

🚀 Middle East Ceasefire Expected to Hold Despite Fragility Jefferies global economist Mohit Kumar has stated that despite the fragility of the Middle East ceasefire agreement, it is expected to hold. According to Odaily, Kumar noted that both parties have reached a point where they desire a ceasefire, as continued conflict would negatively impact both sides. Kumar highlighted that U.S. President Donald Trump is keen on reaching an agreement, as he lacks support from his core base for ongoing warfare. Meanwhile, the Iranian Revolutionary Guard faces challenges due to economic devastation, potentially paving the way for future uprisings. He concluded that given the interests of both parties, the unstable ceasefire is likely to persist. #MiddleEast#Ceasefire#MohitKumar#US#Iran#DonaldTrump#Conflict#RevolutionaryGuard#GlobalEconomics#PeaceAgreement#Odaily

Crypto M - Crypto News

@CryptoM · Post #65217 · 12.04.2026 г., 03:45

🚀 WLFI Co-Founder Addresses Misunderstandings on X Platform WLFI co-founder Zach Witkoff has responded to recent criticisms on the X platform regarding the WLFI project. According to Odaily, Witkoff clarified several points to address misconceptions. Firstly, he emphasized that WLFI should not be confused with the Trump meme coin, as they are entirely unrelated. He also stated that WLFI has no connection with 'fight fight fight' or CIC Digital Company. Witkoff highlighted that early investors purchased WLFI at prices of $0.015 and $0.05, with the current price standing at $0.08. He further explained that the project's primary product is not transaction fees but a stablecoin that generates returns through holding government bonds. This stablecoin ranks as the second-largest compliant stablecoin by trading volume and market capitalization, which he described as a significant achievement. Witkoff advised critics to conduct more thorough research before writing extensive posts on the matter. #WLFI#ZachWitkoff#XPlatform#TrumpMemeCoin#Stablecoin#GovernmentBonds#Investors#Misunderstandings#CICDigitalCompany#Cryptocurrency#Odaily#MarketCapitalization