@StickersChannel · Post #767 · 07.02.2016 г., 14:08
❎ Niki Ice Age ❎ https://telegram.me/addstickers/Niiikage #Niki#IceAge#Movies ↘️more Stickers at S4T.tv
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
Пребарај: #iceage
@StickersChannel · Post #767 · 07.02.2016 г., 14:08
❎ Niki Ice Age ❎ https://telegram.me/addstickers/Niiikage #Niki#IceAge#Movies ↘️more Stickers at S4T.tv
@interesting_planet_facts · Post #1090 · 01.12.2025 г., 18:11
🌎 The mysterious extinction of the “Siberian unicorn,” or Elasmotherium sibiricum, puzzles paleontologists. This massive Ice Age mammal, related to modern rhinos, had a large forehead horn and grazed Eurasian steppes. DNA studies show it survived until about 39,000 years ago—much later than once thought. ✨ #extinctanimals⚡#paleontology⚡#iceage 👉subscribe Interesting Planet 👉more Channels
@interesting_planet_facts · Post #877 · 08.10.2025 г., 15:11
🌎 The woolly rhinoceros, Coelodonta antiquitatis, roamed Ice Age Eurasia with a thick fur coat and massive horn. Fossils found in Siberian permafrost show it survived extreme cold; its extinction about 14,000 years ago is linked to climate warming and human hunting. ✨ #extinctanimals⚡#paleontology⚡#iceage 👉subscribe Interesting Planet 👉more Channels
@interesting_planet_facts · Post #812 · 25.09.2025 г., 15:11
🌎 The giant short-faced bear, Arctodus simus, roamed North America during the last Ice Age. Standing up to 1.5 meters at the shoulder, it was one of the largest terrestrial mammalian carnivores ever, yet paleontologists debate if it was mainly a predator or a scavenger. Fossils suggest it vanished around 11,000 years ago, along with much other megafauna. ✨ #extinctanimals⚡#paleontology⚡#iceage 👉subscribe Interesting Planet 👉more Channels
@interesting_planet_facts · Post #715 · 09.09.2025 г., 03:22
🌎 The Siberian unicorn, or Elasmotherium, was a massive prehistoric rhinoceros with a single huge horn on its forehead. Fossils show it roamed Eurasia until about 39,000 years ago, much later than once believed. ✨ #extinctanimals⚡#paleontology⚡#iceage 👉subscribe Interesting Planet
@googlefactss · Post #40694 · 23.02.2026 г., 07:01
The Little Ice Age (1300–1850) was a cooler period in Europe and North America. ❄️ It was caused by lower solar activity (Maunder Minimum 1645–1715), volcanic eruptions, and natural climate changes. 🌋🌍 Earth is still in an ice age (Quaternary Ice Age) but currently in a warm interglacial period (Holocene, estimated 11,700 years ago). 🌡️ [Read more] #LittleIceAge#ClimateHistory#IceAge#Science#EarthFacts@googlefactss