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

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #183 · 23 ное.

Python + bash Если вам часто требуется запускать shell команды из Python-кода, какой способ вы используете? Самый низкоуровневый это функция os.system(), либо os.popen(). Рекомендованный способ это subprocess.call(). Но это всё еще достаточно неудобно. Советую обратить своё внимание на очень крутую библиотеку sh. Что она умеет? 🔸 удобный синтаксис вызова команд как функций # os import os os.system("tar cvf demo.tar ~/") # subprocess import subprocess subprocess.call(['tar', 'cvf', 'demo.tar', '~/']) # sh import sh sh.tar('cvf', 'demo.tar', "~/") 🔸 простое создание функции-алиаса для длинной команды fn = sh.lsof.bake('-i', '-P', '-n') output = sh.grep(fn(), 'LISTEN') в этом примере также задействован пайпинг 🔸 удобный вызов команд от sudo with sh.contrib.sudo: print(ls("/root")) Такой запрос спросит пароль. Чтобы это работало нужно соответствующим способом настроить юзера. А вот вариант с вводом пароля через код. password = "secret" sudo = sh.sudo.bake("-S", _in=password+"\n") print(sudo.ls("/root")) Это не все фишки. Больше интересных примеров смотрите в документации. Специально для Windows💀 юзеров #libs#linux

Hashtags

Резултати

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

Пребарај: #safetymeasures

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

@ai_and_law · Post #97 · 29.08.2023 г., 07:04

Majority of Americans Call for Federal AI Regulation Hello, everyone! A recent poll conducted by the Artificial Intelligence Policy Institute has unveiled a strong desire among Americans for federal regulation of artificial intelligence. The poll surveyed 1,001 registered US voters, revealing that 62% expressed varying levels of concern about AI, with a remarkable 86% believing that AI could inadvertently lead to a catastrophic event. Interestingly, the majority of respondents (56%) support the idea of a federal agency overseeing AI regulation, while a striking 82% voiced their skepticism about leaving the task to tech executives. Additionally, 72% of participants expressed a preference for slowing down AI development, emphasizing caution over haste. The sentiments expressed in the poll echo the concerns raised by experts in the field, including figures like OpenAI CEO Sam Altman, Tesla CEO Elon Musk, AI pioneer Geoffrey Hinton, and even President Joe Biden, who have all highlighted the importance of addressing AI's potential risks and advocating for regulation. #AI#Regulation#AIrisks#PublicOpinion#Technology#OpenAI#RegulatoryFramework#SafetyMeasures