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

Резултати

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

Пребарај: #secureai

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

@ai_and_law · Post #299 · 03.05.2024 г., 07:04

USA: New Bill Targets AI Security with Breach Tracking and Counter-AI Measures Senators Warner and Tillis have introduced the Secure Artificial Intelligence Act, aiming to bolster security measures surrounding AI systems. The bill proposes an AI Security Center within the National Security Agency (NSA) to manage a database recording all AI security breaches, including close calls ("near-misses"). The legislation establishes a dedicated unit within the NSA to lead research on "counter-AI" techniques. This includes methods to identify and prevent manipulation of AI systems, such as: ✅Data Poisoning: Malicious insertion of code into training data to skew an AI model's output. ✅Evasion Attacks: Altering data used by AI models to intentionally confuse them. ✅Privacy-Based Attacks: Exploiting vulnerabilities in AI systems to compromise user privacy. ✅Abuse Attacks: Misusing AI models for malicious purposes. The Secure Artificial Intelligence Act will undergo committee review before potential consideration by the full Senate. #SecureAI

Hashtags

AI & Law

@ai_and_law · Post #35 · 21.06.2023 г., 07:04

£54 million boost to develop secure and trustworthy AI research The UK government has announced a significant investment of £54 million to support the development of secure and trustworthy AI. The funding will be allocated to various projects and initiatives focused on enhancing the security and trustworthiness of AI systems. This includes advancing research on AI algorithms, data privacy, and cybersecurity measures. The aim is to address critical challenges such as algorithmic bias, data protection, and ethical considerations in AI development and deployment. #AIresearch#SecureAI#TrustworthyAI#UKgovernment#Innovation#EthicalAI#DataPrivacy#Cybersecurity