@sgmrt · Post #1567 · 14.12.2022 г., 04:29
[EWL] UPDATE: Train svc btwn #GulCircle and #Lakeside have resumed. Free regular bus and free bridging bus btwn #GulCircle and #Lakeside have ceased. - SMRT
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
Пребарај: #lakeside
@sgmrt · Post #1567 · 14.12.2022 г., 04:29
[EWL] UPDATE: Train svc btwn #GulCircle and #Lakeside have resumed. Free regular bus and free bridging bus btwn #GulCircle and #Lakeside have ceased. - SMRT
Hashtags
@sgmrt · Post #1566 · 14.12.2022 г., 04:15
[EWL] UPDATE: Train svc btwn #GulCircle and #Lakeside have resumed. Free regular bus & free bridging bus is still available btwn #GulCircle and #Lakeside. - SMRT
Hashtags
@sgmrt · Post #1565 · 14.12.2022 г., 04:15
[EWL] UPDATE: Train svc btwn #GulCircle and #Lakeside have resumed. Free regular bus is still available btwn #GulCircle and #Lakeside. Free bridging bus ceased. - SMRT
Hashtags
@sgmrt · Post #1564 · 14.12.2022 г., 03:32
[EWL]: Due to a signalling fault, there is no train svc btwn #GulCircle and #Lakeside. Free regular bus and free bus bridging is available btwn #GulCircle and #Lakeside. - SMRT
Hashtags
@sgmrt · Post #2304 · 04.04.2025 г., 07:39
[EWL] UPDATE: Due to a track fault, please expect an additional 20 mins of travelling time between #Queenstown and #BoonLay. Shuttle train is available between #JurongEast and #Lakeside. Please look out for fellow commuters in need and give a helping hand. We apologise for - SMRT
@sgmrt · Post #2303 · 04.04.2025 г., 07:39
[EWL] UPDATE: Due to a track fault, please expect an additional 20 mins of travelling time between #Queenstown and #BoonLay. Shuttle train is available between #JurongEast and #Lakeside. Please look out for fellow commuters in need and give a helping hand. We apologise for https://bit.ly/3Rz4KwF - SMRT
@sgmrt · Post #2299 · 04.04.2025 г., 06:54
[EWL] UPDATE: Due to a track fault, please expect an additional 20mins of travelling time between #Queenstown and #BoonLay. Shuttle train is available between #JurongEast and #Lakeside. Free regular bus is available between #BuonaVista and #BoonLay. If you have any enquiries, - SMRT
@sgmrt · Post #2297 · 04.04.2025 г., 06:24
[EWL] UPDATE: Due to a track fault, please expect an additional 20mins of travelling time between #Queenstown and #BoonLay. Shuttle train is available between #JurongEast and #Lakeside. Free regular bus is available between #BuonaVista and #BoonLay. Train service is still - SMRT
@sgmrt · Post #2294 · 04.04.2025 г., 05:39
[EWL]: Due to a track fault, please expect an additional 20mins of travelling time between #Queenstown and #BoonLay. Shuttle train is available between #JurongEast and #Lakeside. Free regular bus is available between #BuonaVista and #BoonLay. - SMRT
@sgmrt · Post #2293 · 04.04.2025 г., 05:34
[EWL]: Due to a track fault, please expect an additional 20mins of travelling time between #Queenstown and #BoonLay. Shuttle train are available between #Clementi and #JurongEast and #JurongEast and #Lakeside. Free regular bus is available between #BuonaVista and #BoonLay. - SMRT