TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

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

Резултати

Пронајдени 3 слични објави

Пребарај: #buddhism

当前筛选 #buddhism清除筛选
Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40743 · 06.03.2026 г., 15:03

The Sukhothai Kingdom was a Siamese kingdom in Mainland Southeast Asia. It was centered in north-central present-day Thailand. It existed from 1238 to 1438. It later became part of the Ayutthaya Kingdom. The kingdom grew strong under rulers like Si Inthrathit and Ram Khamhaeng. People spoke Old Thai and practiced Theravada Buddhism. 🏯🇹🇭📜 [Read more] @googlefactss #Sukhothai#ThaiHistory#SoutheastAsia#Ayutthaya#Buddhism

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40756 · 07.03.2026 г., 07:04

Theravāda Buddhism means “Teaching of the Elders.” It is the oldest surviving school of Buddhism. It follows the Pāli Canon. It teaches the Four Noble Truths: life includes suffering; suffering is caused by craving; suffering can end; the path ends suffering. The Noble Eightfold Path is: right view, right intention, right speech, right action, right livelihood, right effort, right mindfulness, and right concentration. The goal is Nibbāna, freedom from rebirth. Meditation and moral conduct are central practices. 🧘‍♂️📜🌏 [Read more] @googlefactss #Buddhism#Theravada#FourNobleTruths#EightfoldPath#WorldReligions

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #40767 · 09.03.2026 г., 07:03

Some Buddhists serve as soldiers even though Buddhism teaches non-violence. Soldiers can protect people, and Buddhism considers the intention behind actions. Actions that reduce suffering can be acceptable according to Buddhist ethics. Concepts like karma and skillful action are important. International humanitarian rules guide soldiers to act carefully. Being a Buddhist does not always mean being completely against war. Martial arts like Kung Fu also connect to Buddhism. They teach discipline, self-control, mindfulness, and protecting others. The goal is training the mind and body, not just fighting. 🕉️⚔️🥋 [Read more] @googlefactss #Buddhism#Ethics#Soldiers#NonViolence#Karma#Protection#SkillfulAction#KungFu#MartialArts#Mindfulness