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

Пребарај: #cryptolessons

当前筛选 #cryptolessons清除筛选
TON Crypto News

@toncoin_rap · Post #176 · 26.09.2024 г., 12:01

🎧⤴ 🐹Tapped for Months, Earned Pennies: Hamster Combat's Epic Letdown😁 After months of relentless tapping, eager "hamsters" finally witnessed the listing of Hamster Combat. These devoted tappers dreamed of millions and luxurious yachts, but reality hit hard when the coin's value failed to meet expectations. Instead of fortune, participants are left with a mere $15 — or even less — in their pockets. This ironic twist highlights the pitfalls of hoping to get rich simply by tapping a phone screen. Chorus: Tapped the screen, chased the dream so far, But all we got was a fading star. Promises of millions turned to dust, Hamster wheels that lost our trust. Verse 1: Half a year we tapped away, Fingers numb every single day. Hamster Combat was the name, Thought we'd rise to wealth and fame. Dreams of yachts and cash in hand, Building castles made of sand. Listing day, the curtain's drawn, Fifteen bucks and illusions gone. Chorus: Tapped the screen, chased the dream so far, But all we got was a fading star. Promises of millions turned to dust, Hamster wheels that lost our trust. Verse 2: Believed the hype, we took the ride, Blinded by that crypto tide. Tapping screens like it was gold, Never thought the truth be told. Hamster races led nowhere, Woke up from that millionaire's dare. Pocket change is all we found, Feet now firmly on the ground. Chorus: Tapped the screen, chased the dream so far, But all we got was a fading star. Promises of millions turned to dust, Hamster wheels that lost our trust. Verse 3: Lessons learned, the hard school's best, There's no shortcut to the crest. Tap and hope won't pay the bills, Real work earns the real thrills. Chasing coins in cyberspace, Never again will we embrace. Time to step off hamster tracks, Focus on the real facts. Chorus: Tapped the screen, chased the dream so far, But all we got was a fading star. Promises of millions turned to dust, Hamster wheels that lost our trust. Bridge: We woke up from that digital trance, No more betting on a chance. Hamster Combat wrote the end, Now it's time our ways to mend. #CryptoReality#HamsterCombat#CryptoLessons #TONCryptoNewsRapStyle 🎧@toncoin_rap