@sgmrt · Post #1504 · 20.09.2022 г., 23:04
[NSL]: Train services has resumed. Free regular bus services between #Yishun and #ToaPayoh has ceased. - SMRT
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
Пребарај: #toapayoh
@sgmrt · Post #1504 · 20.09.2022 г., 23:04
[NSL]: Train services has resumed. Free regular bus services between #Yishun and #ToaPayoh has ceased. - SMRT
@sgmrt · Post #1503 · 20.09.2022 г., 22:49
[NSL] UPDATE: Due to a track fault, pls add 15mins train travel time btwn #Yishun and #ToaPayoh. Free regular bus svcs from #Yishun to #ToaPayoh. - SMRT
@sgmrt · Post #1501 · 20.09.2022 г., 22:23
[NSL]: Due to a track fault, pls add 15mins train travel time btwn #Yishun and #ToaPayoh. Free regular bus svcs from #Yishun to #ToaPayoh. Our station staff will assist. - SMRT
@sgmrt · Post #1500 · 20.09.2022 г., 22:07
[NSL]: Due to a track fault, pls add 15mins train travel time btwn #Yishun and #ToaPayoh. - SMRT
@sgmrt · Post #2386 · 08.07.2025 г., 01:54
[NSL] UPDATE: Track fault cleared, train services are progressively being restored. Please add 10mins train travel time from #ToaPayoh to #Somerset. - SMRT
@sgmrt · Post #2318 · 16.04.2025 г., 04:29
[NSL]: Due to a track fault, please add 15mins travel time from #ToaPayoh to #Bishan towards #JurongEast. Free regular buses are available between #ToaPayoh and #Bishan. - SMRT
Hashtags
@sgmrt · Post #2317 · 16.04.2025 г., 04:14
[NSL]: Due to a track fault, please add 15mins train travel time from #ToaPayoh to #Bishan towards #JurongEast. Free regular buses are available between #ToaPayoh and #Bishan. Please look out for fellow commuters with special needs and lend a helping hand. We are sorry for - SMRT
Hashtags
@sgmrt · Post #2316 · 16.04.2025 г., 04:05
[NSL]: Due to a track fault, please add 15mins train travel time from #ToaPayoh to #Bishan towards #JurongEast. Free regular bus is available between #ToaPayoh and #Bishan. (Refer to Diagram 1) https://bit.ly/3YBCjlJ - SMRT
Hashtags
@sgmrt · Post #2314 · 16.04.2025 г., 03:29
[NSL]: Due to a track fault, pls add 15mins train travel time from #ToaPayoh to #Bishan towards #JurongEast. Free regular bus is available between #ToaPayoh and #Bishan. - SMRT
Hashtags
@sgmrt · Post #2226 · 10.01.2025 г., 10:44
[NSL] CLEARED: Fault cleared, train service between #MarinaSouthPier and #Bishan has resumed. Free regular bus svc btwn #MarinaSouthPier and #ToaPayoh has ceased. - SMRT
Hashtags
@sgmrt · Post #2225 · 10.01.2025 г., 10:39
[NSL] UPDATE: Train service between #MarinaSouthPier and #Bishan has resumed. Free regular bus svc btwn #MarinaSouthPier and #ToaPayoh has ceased. Trains are running normally. - SMRT
Hashtags
@sgmrt · Post #2224 · 10.01.2025 г., 10:34
[NSL] UPDATE: Train service between #MarinaSouthPier and #Bishan has resumed. Free regular bus svc btwn #MarinaSouthPier and #ToaPayoh is still available. - SMRT
Hashtags