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

Резултати

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

Пребарај: #brain

当前筛选 #brain清除筛选
Ignition of cognition

@neurobros · Post #456 · 17.02.2025 г., 18:48

Еще один свежий обзор на тему коммуникации нервной и иммунной систем: авторы вводят понятие 'нейроиммунного коннектома', который определяют как совокупность нейроиммунных взаимодействий в организме. Полный текст выкладываю в комментарии.👇 В мае пройдет Гордоновская конференция: “Neuroimmune Communication in Health and Disease”. — См. также недавнюю публикацию по нейроиммунологии. #therapy | #brain

Machinelearning

@ai_machinelearning_big_data · Post #7987 · 08.07.2025 г., 20:13

🧠 Учёные разработали мозговой интерфейс, который переводит мысли в речь с интонацией Свежая статья в *Nature* описывает, как человек с параличом получил голос благодаря нейроимпланту. Устройство считывает активность мозга и синтезирует речь со скоростью 40–60 слов/мин и точностью воспроизведения более 60 %. 📍 Как это работает: — В мозг имплантированы 256 микродатчиков в вентральную двигательную префронтальную извилину — зону, отвечающую за речь — Нейросеть расшифровывает активность речевой зоны — Голос синтезируется мгновенно (~25 мс задержки) — Человек *слышит* свой голос и может менять интонацию, задавать вопросы и даже петь 💬 Важно: Это не просто текст. Это живая речь с эмоциями, восстановленная у человека, полностью утратившего возможность говорить. Перспективная технология для всех, кто потерял голос. 📌Полная статья @ai_machinelearning_big_data #ml#ai#brain#nature

Interesting Planet 🌍

@interesting_planet_facts · Post #1363 · 03.04.2026 г., 12:11

🌎 Humans can perceive their own thoughts by using the brain’s “default mode network” (DMN), a group of regions active during self-reflection and daydreaming. The DMN uses up to 20% of the brain’s total energy when awake. ✨ #brain⚡#consciousness⚡#neuroscience 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1031 · 14.11.2025 г., 12:11

🌎 Consciousness studies reveal that some patients in vegetative states still show minimal awareness. Brain scans detect distinct patterns when they are asked to imagine specific activities. These brain responses resemble those of healthy people, showing hidden layers of awareness even without outward signs. ✨ #brain⚡#consciousness⚡#neuroscience 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #997 · 02.11.2025 г., 12:11

🌎 Brains process language mostly on the left side, but imaging studies reveal that understanding jokes or irony also activates areas on the right. This pattern appears in over 90% of right-handed people. ✨ #brain⚡#neuroscience⚡#consciousness 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #925 · 17.10.2025 г., 18:11

🌎 The phenomenon of "predictive coding" means your brain constantly generates guesses about what's coming next, allowing you to react faster to new information. This system helps you interpret sights, sounds, and even social cues by comparing real signals to expectations, updating your perception in real time. Brain scans show this process is most active in the cerebral cortex. ✨ #brain⚡#neuroscience⚡#consciousness 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #856 · 04.10.2025 г., 12:11

🌎 The brain’s default mode network activates when you daydream or let your mind wander. This network is involved in self-reflection and retrieving personal memories. MRI studies show it consumes nearly as much energy as active, focused thinking. ✨ #brain⚡#consciousness⚡#neuroscience 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #793 · 21.09.2025 г., 18:11

🌎 Locked inside your skull, the human brain contains over 86 billion neurons. These nerve cells communicate through trillions of connections, forming complex circuits that create consciousness. Remarkably, all our thoughts, memories, and perceptions arise from electrical and chemical signals passing between these tiny cells. ✨ #brain⚡#neuroscience⚡#consciousness 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #758 · 16.09.2025 г., 00:22

🌎 The phenomenon called "blindsight" occurs when people with damage to their visual cortex can respond to visual stimuli without conscious awareness. Their eyes and optic nerves work, but the brain's primary visual center is injured—yet they can still guess locations or movements of objects correctly. Studies show blindsight patients perform above chance when identifying light or motion in their blind field. ✨ #brain⚡#consciousness⚡#neuroscience 👉subscribe Interesting Planet ​

123•••10•••20•••30•••3334
ПретходнаСтраница 1 од 34Следна