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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #191 · 14 дек.

Как разделить строку с shell-командой на отдельные аргументы в виде списка? Если сделать просто сплит по пробелу то получим то что надо, кроме случаев со вставками текста с пробелами. Например так: >>> '-arg "I Am Groot"'.split(' ') ['-arg', '"I', 'Am', 'Groot"'] Чтобы учитывать текст в кавычках как единый аргумент можно воспользоваться функцией shlex.split() Кто читает мой канал давно, уже в курсе. А что делать, если нужно обратное действие? Объединить аргументы из списка в строку и при этом добавить кавычки в аргумент с пробелами. Конечно, если вы используете subprocess то он сам всё разрулит. Но если вам нужна именно команда одной строкой, то можно воспользоваться готовой функцией в том же subprocess. >>> from subprocess import list2cmdline >>> list2cmdline(['-arg', 'I Am Groot']) '-arg "I Am Groot"' Он также позаботится об экранировании уже имеющихся кавычек >>> list2cmdline(['-arg', 'I Am "Groot"']) '-arg "I Am \"Groot\""' А вот так он может "схлопнуть" в команду JSON >>> list2cmdline(['--json', json.dumps({'key': 'value'})]) '--json "{\"key\": \"value\"}"' _______________ Возможно кто-то спросит, а зачем соединять аргументы в строку если subprocess сам это сделает а os.system не наш путь? Мне как-то потребовалось отправлять команду на удалённое выполнение и в API поддерживалось указание команды только строкой. Так что всякое бывает) #libs#basic

Hashtags

Резултати

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

Пребарај: #bnt

当前筛选 #bnt清除筛选
Coin Sonar

@CoinSonar · Post #244248 · 18.04.2026 г., 15:28

#BNT | Volume spike (USDT PAIR) 1444 times the average volume 95.60K USDT traded in 1 min └Buying vol: 75.81K USDT 🟢 Boost score: 8/10 24h Vol: 95.28K USDT (Binance) Price: 0.3324 (-2.4% in 24h)

Hashtags

Pro Analysis

@proanalysistrader · Post #28150 · 09.11.2024 г., 16:02

#BNT/USDT analysis : #BNT has recently broken out of the mini consolidation at the support level. The price is expected to rise further and continue its bullish momentum to test swing high levels. For confirmation of a long entry, it is advisable to wait for a weekly candle to close above the $0.5580 level. A potential gain of 70% is anticipated, with a stop-loss set at the $0.4130 level. TF : 1W Entry : $0.5580 Target : $0.9750 SL : $0.4130

Hashtags

Pro Analysis

@proanalysistrader · Post #27841 · 15.08.2024 г., 04:49

#BNT/USDT analysis : The current correction phase of #BNT indicates an upcoming rejection followed by a continuation of its downtrend with a strong bearish move. It is likely to test its previous swing low. Consider entering the market upon the breakout of the $0.464 level. TF : 2H Entry : $0.464 Target : $0.397 SL : $0.501

Hashtags

American Crypto©

@americancryptotrading · Post #27503 · 15.01.2026 г., 09:40

🇺🇸#BNT/USDT is testing the lowerborder of the descendingtriangle on the weekly chart🧐 Market recovery is underway📈 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27452 · 28.11.2025 г., 06:23

🇺🇸#BNT/USDT has found support at the lowerboundary of the descendingtriangle pattern on the weekly chart🧐 Looking for a move up if we bounce📈 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27071 · 03.12.2024 г., 15:05

🇺🇸#BNT/USDT is breaking the symmetrical triangle pattern on the weekly timeframe📈 Bullish case✈️ American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27025 · 22.10.2024 г., 10:45

🇺🇸#BNT/USDT produced a descendingchannel formation on daily timeframe🔍 Expecting Upside Breakout🚀 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27017 · 15.10.2024 г., 12:11

🇺🇸#BNT/USDT produced a descendingchannel formation on daily timeframe🔍 Expecting Upside Breakout🚀 American Crypto©

Hashtags

Maximus Trade 🌕

@maximustrade1 · Post #7637 · 18.10.2023 г., 17:50

#BNT SHORT ▪Вход: 0.57$ ▪Тейк: буду обновлять. пс: учитываем, что это альткоин... торгуем соблюдая риски. LINK - Maximus Trade|TWITTER

Hashtags

12
ПретходнаСтраница 1 од 2Следна