@trading_pit_signal · Post #34124 · 08.02.2024 г., 14:42
Remember to share team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
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
Пребарај: #screenshot
@trading_pit_signal · Post #34124 · 08.02.2024 г., 14:42
Remember to share team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags
@trading_pit_signal · Post #33919 · 06.02.2024 г., 07:21
Remember to share FEEDBACK team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags
@trading_pit_signal · Post #33602 · 31.01.2024 г., 14:14
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33601 · 31.01.2024 г., 14:14
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33599 · 31.01.2024 г., 14:13
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33598 · 31.01.2024 г., 14:07
Remember to share FEEDBACK team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags
@trading_pit_signal · Post #33552 · 31.01.2024 г., 08:59
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33550 · 31.01.2024 г., 08:56
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33537 · 31.01.2024 г., 07:38
Remember to share FEEDBACK team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags
@trading_pit_signal · Post #33493 · 30.01.2024 г., 12:53
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33491 · 30.01.2024 г., 12:52
You can see gold🔥 and currency pairs 🔥 This is how it's done guys. #Screenshot your profit and send to admin. Click on the pinned message and contact admin
Hashtags
@trading_pit_signal · Post #33487 · 30.01.2024 г., 12:45
Remember to share team keep motivating. #Screenshot those Blue blizzards we going for more TP's MORE FEEDBACK MORE SIGNALS
Hashtags