@sgmrt · Post #2390 · 19.07.2025 г., 06:49
[BPLRT]: Due to a train fault, trains are moving slower towards #ChoaChuKang on Service A. We are investigating the fault. https://bit.ly/450rFrj - 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
Пребарај: #choachukang
@sgmrt · Post #2390 · 19.07.2025 г., 06:49
[BPLRT]: Due to a train fault, trains are moving slower towards #ChoaChuKang on Service A. We are investigating the fault. https://bit.ly/450rFrj - SMRT
Hashtags
@sgmrt · Post #1961 · 03.06.2024 г., 12:39
[UPDATE] [NSL] : South bound train service from #ChoaChuKang to #Woodlands has resumed. Free Regular Bus and Bridging Bus have ceased. - SMRT
Hashtags
@sgmrt · Post #1960 · 03.06.2024 г., 12:14
[UPDATE] [NSL] : South bound train service from #ChoaChuKang to #Woodlands has resumed. Free Regular Bus and Bridging Bus Services are still available between #ChoaChuKang and #Woodlands. - SMRT
Hashtags
@sgmrt · Post #1959 · 03.06.2024 г., 11:54
[UPDATE] [NSL]North bound trains from #Woodlands towards #ChoaChuKang is in service. - SMRT
Hashtags
@sgmrt · Post #1958 · 03.06.2024 г., 11:49
[UPDATE] [NSL]Due to traction power fault, there is no South bound train service from #ChoaChuKang to #Woodlands. Free Regular Bus and Bridging Bus Services are available between #ChoaChuKang and #Woodlands, passengers are advised to take alternative lines via [TEL] & [CCL] line. - SMRT
Hashtags
@sgmrt · Post #1617 · 05.02.2023 г., 23:53
[NSL] UPDATE: Fault cleared, train services are progressively being restored. You may still experience crowding at some stations. Free regular bus & free bridging bus services are still available btwn #ChoaChuKang and #Yishun. - SMRT
Hashtags
@sgmrt · Post #1615 · 05.02.2023 г., 23:39
[NSL] UPDATE: Fault cleared, train services are progressively being restored. Pls add 5mins train travel time btwn #Yishun and #ChoaChuKang. Free regular bus & free bridging bus services are still available btwn #ChoaChuKang and #Yishun. - SMRT
Hashtags
@sgmrt · Post #1614 · 05.02.2023 г., 23:23
[NSL] UPDATE: Fault cleared, train services are progressively being restored. Pls add 15mins train travel time btwn #Yishun and #ChoaChuKang. Free regular bus and free bridging bus services are still available btwn #ChoaChuKang and #Yishun. - SMRT
Hashtags
@sgmrt · Post #1613 · 05.02.2023 г., 23:10
[NSL]: UPDATE: Due to a track fault, pls add 25mins train travel time btwn #ChoaChuKang and #Yishun. Free regular bus is available btwn #ChoaChuKang and #Yishun. You may take TEL or other alternative lines to city area. - SMRT
Hashtags
@sgmrt · Post #1612 · 05.02.2023 г., 23:10
[NSL]: UPDATE: Due to a track fault, pls add 25mins train travel time btwn #ChoaChuKang and #Yishun. Free regular bus and free bridging bus services are available btwn #ChoaChuKang and #Yishun. You may take TEL or other alternative lines to city area. - SMRT
Hashtags
@sgmrt · Post #1611 · 05.02.2023 г., 22:53
[NSL]: UPDATE: Due to a track fault, pls add 15mins train travel time btwn #ChoaChuKang and #Yishun. Free regular bus is available btwn #ChoaChuKang and #Yishun. You may also take alternative line to city area. - SMRT
Hashtags
@sgmrt · Post #1610 · 05.02.2023 г., 22:53
[NSL]: UPDATE: Due to a track fault, pls add 15mins train travel time btwn #ChoaChuKang and #Yishun. Free regular bus is available btwn #ChoaChuKang and #Yishun. You may take TEL or other alternative lines to city area. - SMRT
Hashtags