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

Резултати

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

Пребарај: #russianbeauties

当前筛选 #russianbeauties清除筛选
Learn RCRussian🤍💙❤️

@learnRCRussian · Post #6104 · 28.01.2026 г., 13:00

🇷🇺Some Russian winter spirit for you! 🎵 🔻Улетай на крыльях ветра by Евгения Сотникова (Fly Away on the Wings of the Wind) is a segment of the vivid ballet scene Polovtsian Dances from the most famous work by A. Borodin — the opera Prince Igor (1875). Video: elizabet_crow (tik tok) #Russian_culture #Russianbeauties 🟠RCR | Support | Boost

Learn RCRussian🤍💙❤️

@learnrcrussian · Post #4369 · 18.03.2025 г., 18:51

Mydear Russian language learners! I often write about beautiful Russian women and beauty contests held in Russia. And now you have an opportunity to be in the jury! One of the subscribers of @learnRCRussian, a beautiful Russian girl Alena (see the photo, isn't she a beauty?), is a participant in the 10th season of the All-Russian beauty contest "Ты уникальная" (You Are Unique). 🟠Her number is 🔴 🔴. The final will be held on March 21st, and also launched is the long-awaited online voting, for which there will be a separate nomination and one of the main crowns: 🔴Miss PHOTO. Voting conditions are simple: 1. Subscribe (very important!): http://vk.com/tu.penza And https://www.instagram.com/tu.penza?igsh=MWxteHJxNzh2Z.. 2. Like the post with number 🔴 🔴 3. Leave a comment The participant with the most likes wins. PS The account is private. You'll get access as soon as you subscribe to the channel. This is a mandatory condition to avoid cheating. 🔴Please support her! Thank you everyone! Natalie with ❤️ #admins_letter #Russianbeauties

Learn RCRussian🤍💙❤️

@learnrcrussian · Post #4104 · 24.01.2025 г., 13:00

In order to become a continuation of the northern lights in the Murmansk region, a Muscovite woman created an unusual luminescent dress. 🔻Natalya Zakharova found suitable luminous paints and created the outfit with her own hands. 🔻The dress became a continuation of the magnificent northern lights on the Kola Peninsula. 🔻Before the photoshoot, the dress had to be charged with light. On the Kola Peninsula at the end of November, the duration of daylight hours is almost zero, and it is not possible to charge naturally. 🔻The girl did not specify how long the shooting itself lasted, but admitted that she "froze to the bone." Photos: Наталья Захарова (vk) #around_Russia #brief_and_interesting #Russianbeauties 😎RCRussian | Support | Boost

Learn RCRussian🤍💙❤️

@learnRCRussian · Post #6012 · 11.01.2026 г., 14:40

The Internet is full of AI Snow maidens, but a creative team from Orenburg just dropped the ultimate response — a stunning music video with REAL girls. 🇷🇺Снегурочка (снегурочки) (femin.noun) [sni-gu-rach-ka (sni-gu-rach-ki)] Snow Maiden(s) 🔻Forget algorithms, this is about roots. Everything is authentically Russian and locally crafted: 🔸Shawls and outfits by Orenburg down-knitters 🔸Kokoshniks by a local designer 🔸All beauties from Orenburg "We are promoting what is our own, what is native," is their powerful motto. So, which version warms your heart more: the AI or this real, living beauty? 🔻Kokoshnik 🔻Orenburg shawls 🔻#Russianbeauties #AI #russian_culture 🟠RCR | Support | Boost

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