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

Резултати

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

Пребарај: #earningscalls

当前筛选 #earningscalls清除筛选
🦅 [ perspective ix ]

@perspectiveix · Post #1986 · 01.05.2020 г., 15:30

📰 Tech, Media, and Business News Headlines—Day 1 👉#Intel unveils 10th-gen desktop CPUs, including 5.3GHz flagship (link) 👉#Zoom admits it doesn't have 300M DAUs, quietly correcting the claim in its original blog post to 300M “daily Zoom meeting participants (link) 👉#Telegram postpones the launch of its TON blockchain for a second time, pushing the go-live date to April 2021, and offers to return $1.2B to investors (link) 👉 Andreessen Horowitz raises $515M for its second fund dedicated to #cryptocurrency and #blockchain investments and holdings (link) 👉#Apple Q2: $58.3B revenue, up 1% YoY; $44.9B from products, $13.35B from services; net income of $11.25B (link) 👉#Amazon Q1: $75.5B revenue, up 26% YoY; net income of $2.5B, down from $3.6B in Q1 2019; $10.2B from AWS revenue, up from $7.7B YoY (link) 👉#Twitter Q1: sales up 3% YoY to $808M; net loss of $8M due to COVID-19; mDAUs hit a record 166M, up 24% YoY (link) #️⃣#EarningsCalls 📰@iXDaily via @PerspectiveIX 💌Weekly Newsletter.

🦅 [ perspective ix ]

@perspectiveix · Post #1995 · 07.05.2020 г., 15:32

Tech, Media, and Business News Headlines—Day 6 👉#France is using #AI to check whether people are wearing masks on public transport (link) 👉#Facebook's Oversight Board, who will focus on challenging content issues, such as hate speech and harassment, announces its first 20 members out of a total of 40 (link) 👉 Comedy Central, MTV, Nickelodeon, and more Viacom channels coming to #YouTubeTV (link) 👉#Zoom acquires #Keybase to get end-to-end encryption expertise (link) 👉 Liberty’s Virgin Media and Telefonica’s O2 to merge in the UK in $39B deal (link) 👉#Square Q1: revenue of $1.38B, up 44% YoY; net loss of $106M, up $68M YoY (link) 👉#Square reports $528M in Q1 revenues from its Cash App, with $306M coming from #Bitcoin transactions, exceeding the app's fiat revenue of $222M for the first time (link) 👉#PayPal Q1: misses estimates with revenue of $4.62B, up 13% YoY; net income of $84M, down from $667M YoY (link) 👉#Shopify Q1: revenue of $470M, up 47% YoY; gross merchandise volume of $17.4B, up 46% YoY (link) #️⃣#EarningsCalls 📰@iXDaily by @PerspectiveIX 💌Weekly Newsletter.

🦅 [ perspective ix ]

@perspectiveix · Post #1994 · 06.05.2020 г., 20:53

Tech, Media, and Business News Headlines—Day 5 👉#Apple will host a virtual #WWDC this year — starts on 22 June (link) 👉#Twitter tests a warning message that tells users to rethink offensive replies (link) 👉#Twitter rolls out changes to threaded conversations following tests in its prototype app, #twttr (link) 👉#Airbnb cuts 1,900 jobs, around 25% of its global workforce (link) 👉#Bitcoin is set for ‘Halving’ this month (link) 👉 Leaked videos show #Lenovo’s first gaming #smartphone (link) 👉#Android 11’s public beta to launch with 3 June via live stream (link) 👉#Google’s #Stadia controller will finally work wirelessly with computers starting this week (link) 👉#Microsoft launches #SurfaceBook 3 (link) and #SurfaceHeadphones 2 (link) 👉#Microsoft offers $100,000 to hack its custom Linux OS (link) 👉#Uber lays off 14% of its workforce in COVID-19-related cost-cutting (link) 👉#Pinterest Q1: revenue of $272M, vs. $270M est., up 35% YoY; user base grew to 367M MAUs, up 26% YoY (link) 👉#EA Q4: revenues of $1.39B, beating expectations of $1.19B, up 12% YoY (link) #️⃣#EarningsCalls 📰@iXDaily by @PerspectiveIX 💌Weekly Newsletter.