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

Резултати

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

Пребарај: #novels

当前筛选 #novels清除筛选
Velvet Pages | eLibrary 🥂

@bookslibraryofficial · Post #1397 · 15.08.2025 г., 14:48

📖Title : The Return of the King ✍️Author : J.R.R. Tolkien ⭐️Rating : 4.58/5 (Goodreads) 📆Published : Oct 20, 1955 ———————————————— Summary:In The Return of the King, the final volume of J.R.R. Tolkien’s The Lord of the Rings, the forces of Gondor and Rohan prepare for the ultimate battle against Sauron. Aragorn embraces his destiny as the true king, rallying allies and marching to the Black Gate as a diversion. Meanwhile, Frodo and Sam struggle through Mordor to destroy the One Ring in Mount Doom. Gollum’s obsession leads to his and the Ring’s destruction, ending Sauron’s reign. Peace returns to Middle-earth, Aragorn is crowned, and the hobbits return to a changed Shire. Frodo later departs with the Elves to the Undying Lands. ———————————————— #fantasy#fiction#classics#adventure#novels#LOTR@Bookslibraryofficial@free_novellas@thesciencelabs

Velvet Pages | eLibrary 🥂

@bookslibraryofficial · Post #1391 · 04.08.2025 г., 15:29

📖Title : The Two Towers ✍️Author : J.R.R. Tolkien ⭐️Rating : 4.50/5 (Goodreads) 📆Published : Nov 11, 1954 ———————————————— Summary:In The Two Towers, the Fellowship is broken. Frodo and Sam continue their perilous journey to Mordor to destroy the One Ring, joined reluctantly by the treacherous yet pitiful Gollum, who becomes both guide and threat. Meanwhile, Aragorn, Legolas, and Gimli pursue the Uruk-hai who have captured Merry and Pippin. Their paths lead to the war-torn kingdom of Rohan, where they aid King Théoden against the forces of Saruman. As darkness spreads and war looms, alliances are tested and hope flickers. The story deepens the moral complexity of the quest, showing how power corrupts and loyalty defines true heroism. ———————————————— #fantasy#fiction#classics#adventure#novels#LOTR@Bookslibraryofficial@free_novellas@thesciencelabs

Telegram 公眾索引頻道

@TG_index_channel · Post #1484 · 27.04.2021 г., 01:40

標題:兽人小说|獸人小説 類別:#公開#頻道#簡中 分類:#閒聊#資源#社群#中文圈#NSFW 標籤:#novels#reading#獸人#furry#小説#閲讀 簡介:獸人小説 @FurryNovels 獸獸分享的獸人小説頻道 加群即可參與分享! #furry#novels#reading#NSFW #獸人#閲讀#小説 TG指南 te.legra.ph/TNTwwxs-09-08-06 中文群組 https://t.me/FurryNovels/27