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

Пребарај: #aicodes

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

@ai_and_law · Post #348 · 09.07.2024 г., 07:04

European Commission's AI Codes of Practice: A Self-Regulation Concern? According to Euractiv, the European Commission plans to let AI model providers draft codes of practice for compliance with the AI Act, with civil society organizations consulted during the process. This approach has sparked concerns about industry self-regulation, as these codes will serve as compliance measures for general-purpose AI models until harmonized standards are set. The Commission may grant EU-wide validity to these codes through an implementing act. Some civil society members worry this could enable Big Tech to essentially write their own rules. The AI Act's language on stakeholder participation in drafting these codes is ambiguous. The Commission has stated that an upcoming call for expressions of interest will clarify how various stakeholders, including civil society, will be involved. However, specifics are still lacking. An external firm will be hired to manage the drafting process, including stakeholder engagement and weekly working group meetings. The AI Office will oversee the process but will primarily focus on approving the final codes. #AIRegulation#EUCommission#AICodes#AIAct#Compliance