@sgmrt · Post #1703 · 18.04.2023 г., 08:37
[CCL] Train service is resuming progressively. Free regular buses are still available btw #BuonaVista and #HarbourFront. - 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
Пребарај: #harbourfront
@sgmrt · Post #1703 · 18.04.2023 г., 08:37
[CCL] Train service is resuming progressively. Free regular buses are still available btw #BuonaVista and #HarbourFront. - SMRT
Hashtags
@sgmrt · Post #2287 · 14.03.2025 г., 11:34
[CCL] CLEARED: Fault cleared trains are running normally between #HarbourFront, #MarinaBay and #DhobyGhaut. - SMRT
@sgmrt · Post #2286 · 14.03.2025 г., 11:34
[CCL] UPDATE: Fault cleared trains are progressively returning to normal between #HarbourFront, #MarinaBay and #DhobyGhaut. Train service is still available. - SMRT
@sgmrt · Post #2285 · 14.03.2025 г., 11:14
[CCL] UPDATE: Fault cleared trains are progressively returning to normal between #HarbourFront, #MarinaBay and #DhobyGhaut. - SMRT
@sgmrt · Post #2284 · 14.03.2025 г., 11:05
[CCL]: Additional 15 mins train travel time between #HarbourFront, #MarinaBay and #DhobyGhaut due to a signal system fault. - SMRT
@sgmrt · Post #1912 · 28.04.2024 г., 22:34
[CCL] UPDATE: Additional 30mins train travel time between #Bishan and #one-north due to a train fault. Free Regular bus service is available between #Bishan and #HarbourFront. You may also use alternative lines to travel to your destination. - SMRT
Hashtags
@sgmrt · Post #1911 · 28.04.2024 г., 22:34
[CCL] UPDATE: Additional 30 mins train travel time between #Bishan and #one-north due to a train fault. Free Regular bus service is available between #Bishan and #HarbourFront. We apologise for this delay to your journey. - SMRT
Hashtags
@sgmrt · Post #1702 · 18.04.2023 г., 08:23
[CCL] Due to a power fault, please add 20 minutes additional train travel time btw #KentRidge and #Harbourfront. Free regular buses are available btw #BuonaVista and #Harbourfront. - SMRT
@sgmrt · Post #1913 · 28.04.2024 г., 22:39
[CCL] UPDATE: Additional 30 mins train travel time between #PayaLebar and #one-north due to a train fault. Free Regular Bus Service is available between #PayaLebar and #HarbourFront. Bridging bus service is available between #PayaLebar and #BuonaVista. - SMRT
@sgmrt · Post #2183 · 15.12.2024 г., 16:44
[CCL] UPDATE: Due to signaling fault, please expect additional 30 mins travelling time btwn #Farrer Road and #HarbourFront. Free regular bus services are available between #Botanic Gardens and #HarbourFront. - SMRT
Hashtags
@sgmrt · Post #1910 · 28.04.2024 г., 22:19
[CCL] UPDATE: Additional 30mins train travel time between #HollandVillage and #PasirPanjang due to a train fault. Free Regular Bus Service is available between #Bishan and #HarbourFront. We apologise for this delay to your journey. - SMRT