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

Резултати

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

Пребарај: #hangsengindex

当前筛选 #hangsengindex清除筛选
Crypto M - Crypto News

@CryptoM · Post #65343 · 13.04.2026 г., 01:23

🚀 Hong Kong Stocks Open Lower as Tech Shares Decline Hong Kong stocks opened lower today, with the Hang Seng Index dropping 0.71% and the Hang Seng Tech Index falling 0.69%. According to Jin10, technology stocks led the decline, with Baidu (09888.HK) down over 3% and NetEase-S (09999.HK) falling more than 2%. #HongKongStocks#HangSengIndex#HangSengTechIndex#TechStocks#Baidu#NetEase

Crypto M - Crypto News

@CryptoM · Post #64505 · 09.04.2026 г., 04:13

🚀 STOCKS | Hong Kong's Hang Seng Index Retreats After Previous Surge On April 9, Hong Kong's Hang Seng Index experienced a pullback following a significant rise of nearly 800 points the previous day. According to Jin10, the index opened over 100 points lower in the morning and briefly fell more than 200 points to reach 25,653.63 points before recovering slightly. By midday, the Hang Seng Index closed down 0.35% at 25,803.12 points, while the Hang Seng Tech Index fell 1.26% to 4,861.39 points. The total market turnover for the Hang Seng Index reached HKD 126.652 billion. In terms of sector performance, optical communication and computing infrastructure stocks led gains, while the innovative drug concept saw a brief surge in early trading. However, most technology stocks underwent a correction, with real estate and gold stocks experiencing notable declines. Among individual stocks, Yangtze Optical Fibre and Cable Joint Stock Limited Company (06869.HK) rose 3.2%, WuXi AppTec Co., Ltd. (02359.HK) increased by 3.53%, Kingdee International Software Group Company Limited (00268.HK) fell 5.49%, Kuaishou Technology (01024.HK) dropped 3.55%, and Longfor Group Holdings Limited (00960.HK) decreased by 4.07%. #HangSengIndex#HongKongStocks#StockMarket#TechStocks#RealEstate#Gold#MarketPullback#Trading#Investment

Crypto M - Crypto News

@CryptoM · Post #64465 · 09.04.2026 г., 01:23

🚀 Hong Kong Stocks Open Lower as Tech Shares Decline Hong Kong's stock market opened with losses today, with the Hang Seng Index down by 0.53% and the Hang Seng Tech Index dropping by 1.11%. According to Jin10, several technology stocks experienced declines, including Alibaba, which fell by 2.69%, and Kuaishou, which decreased by 2.53%. #HongKongStocks#HangSengIndex#TechShares#Alibaba#Kuaishou#StockMarket#TechDecline

Crypto M - Crypto News

@CryptoM · Post #64811 · 10.04.2026 г., 01:25

🚀 STOCKS | Hong Kong Stocks Open Higher with Semiconductor Gains Hong Kong stocks opened with gains as the Hang Seng Index rose by 0.54% and the Hang Seng Tech Index increased by 0.47%. According to Jin10, Hua Hong Semiconductor saw a rise of over 3.5%, while CATL and WH Group both experienced nearly 3% increases. In contrast, NIO faced a decline of more than 6.5%, and Baidu dropped over 3.5%. #HongKongStocks#HangSengIndex#HangSengTechIndex#Semiconductors#HuaHongSemiconductor#CATL#WHGroup#NIO#Baidu#StockMarket