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

Пребарај: #aichampions

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

@ai_and_law · Post #62 · 20.07.2023 г., 07:04

Europe's AI Battle: France vs. UK in the Race for Supremacy Hello AI enthusiasts! It seems like French President Emmanuel Macron and British Prime Minister Rishi Sunak are locking horns to claim the throne of AI dominance in Europe. 🔹The Race for Funds: Macron announced a whopping €500 million investment to create new AI champions in France, on top of previous commitments. Meanwhile, the U.K. government pledged £1 billion for supercomputing and AI research to become a "science and technology superpower." 🔹 Regulation Approaches: France falls under the jurisdiction of the EU's AI Act, focusing on risk assessment and banning certain AI applications. On the other hand, the U.K. takes a principles-based approach, advising industry regulators on enforcing existing rules flexibly and pro-innovation. 🔹 Who Will Reign Supreme? Experts are divided. France has access to talent and startups, but the EU AI Act may pose challenges. The U.K.'s approach prioritizes investment, but concerns about political uncertainties remain. 🌍 Collaboration for Success: While the competition heats up, industry leaders emphasize the need for European tech hubs to join forces, fostering collaboration and investing in a robust ecosystem to challenge U.S. AI giants. Who will emerge victorious and claim the crown of Europe's AI champion? #AIChampions#AIRegulations#TechRace#AI