@Perse_pol_is · Post #190 · 17.03.2020 г., 14:11
Relief of a #Median tribute bearer presenting an Acinace for the king, excavated in Persepolis.
Hashtags
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
Пребарај: #median
@Perse_pol_is · Post #190 · 17.03.2020 г., 14:11
Relief of a #Median tribute bearer presenting an Acinace for the king, excavated in Persepolis.
Hashtags
@Perse_pol_is · Post #189 · 16.03.2020 г., 09:30
#Median Art. Glazed vase decorated with goats and a lotus flower, 7th century BC, part of the Ziwiyeh hoard.
Hashtags
@Perse_pol_is · Post #147 · 22.02.2020 г., 18:34
#Median art. Gold protoma of a bull, 8th century BC, possibly part of the Ziwiyeh treasure. Currently housed in the national museum of Warsaw.
Hashtags
@Perse_pol_is · Post #128 · 04.02.2020 г., 17:29
"The Medes were formerly called by everyone Aryans, but when the Colchian woman Medea came from Athens to the Aryans they changed their name, like the Persians. This is the Medes' own account of themselves. " —Herodotus, The Histories, Book 7, Chapter 62. [Picture]: Bust of a #Median lion strangler, 5th century BC.
Hashtags
@Perse_pol_is · Post #123 · 03.02.2020 г., 17:30
A 6th century BC silver rython depicting a #Median horserider, with his people's distinctive round hat. Excavated in Erebuni, Urartian "fortress of blood" which was occupied by the Medians and the Persians.
Hashtags
@Perse_pol_is · Post #122 · 03.02.2020 г., 17:24
Gold rython in shape of a ram's head, excellent example of #Median art, part of the Ziwiyeh treasure.
Hashtags
@Perse_pol_is · Post #148 · 22.02.2020 г., 19:04
Bas-relief of a #Persian (right) and #Median (left) lancer, Persepolis.