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 слични објави

Пребарај: #mqtt

当前筛选 #mqtt清除筛选
Libreware

@libreware · Post #1548 · 15.02.2026 г., 11:52

Stop Trusting #Messaging Apps! Build Your Own Global #Meshtastic#MQTT Network - Explained Simply Most messaging apps promise privacy, but very few let you control the infrastructure behind your conversations. https://rumble.com/v75rxrg #im#mesh#p2p

GitHub Trends

@githubtrending · Post #15331 · 14.12.2025 г., 12:00

#c_lang#bk7231#bk7231n#bk7231t#bl602#home_assistant#iot#ln882h#mqtt#smart_home#tasmota#tuya#w600#w601#w800#w801#wifi#xr809 OpenBeken is a free Tasmota-like firmware for Tuya devices with chips like BK7231T/N, BL602, W600, ESP32, and 20+ others, adding MQTT, Home Assistant auto-discovery, OTA updates, scripting, sensors, power metering, and RGB LED control. Download ready binaries, flash easily via GUI tools or UART, and use a 700+ device database with guides. You gain cloud-free smart home control, easy local setup without AP mode, lower power use, and full customization for reliable automation. https://github.com/openshwprojects/OpenBK7231T_App

GitHub Trends

@githubtrending · Post #15204 · 08.10.2025 г., 11:30

#java#cloud#coap#dashboard#iot#iot_analytics#iot_platform#iot_solutions#java#kafka#lwm2m#microservices#middleware#mqtt#netty#platform#snmp#thingsboard#visualization#websockets#widgets ThingsBoard is an open-source IoT platform that helps manage and analyze data from connected devices. It allows users to collect data, create real-time dashboards, and automate tasks using a powerful rule engine. This platform supports various protocols like MQTT and HTTP, making it easy to connect devices. Users can also define relationships between devices and assets, and trigger alarms based on specific conditions. The benefit is that it simplifies IoT project development, making it scalable and efficient for applications like smart farming, smart offices, and more. https://github.com/thingsboard/thingsboard