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

Резултати

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

Пребарај: #ethicsandai

当前筛选 #ethicsandai清除筛选
AI & Law

@ai_and_law · Post #56 · 14.07.2023 г., 07:04

Google takes steps towards responsible AI in the EU Hey there, AI and Law friends! 👋 We have an exciting update to share with you today. Google is making significant strides towards responsible AI in the EU. They are actively engaging in discussions with regulators about the AI Act, a crucial piece of legislation. Led by Thomas Kurian, Google's cloud computing division is addressing the concerns raised by the EU regarding artificial intelligence. One of the main challenges discussed is the ability to distinguish between human-generated and AI-generated content. But fear not! Google has come up with a clever solution. They have introduced a "watermarking" feature that labels AI-generated images, making it easier for users to identify them. On top of that, Google is actively working on developing innovative technologies to ensure that people can easily differentiate between content created by humans and content generated by AI. This move showcases how major tech companies like Google are taking the lead in implementing private sector-driven oversight of AI. They are not waiting for formal regulations to be in place; they are proactively working on solutions to ensure responsible and ethical AI practices. Now, here's a thought-provoking question for you all: Can technology companies and regulatory bodies effectively collaborate to ensure responsible and ethical AI practices? #AIRegulations#ResponsibleAI#TechIndustry#EthicsAndAI