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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #309 · 2 фев.

Метод строки split() разделяет строку на несколько строк по указанному символу >>> "a_b_c".split('_') ['a', 'b', 'c'] Можно указать максимальное количество разделений >>> "a_b_c".split('_', 1) ['a', 'b_c'] Или резать с другой стороны с помощью rsplit() (right split) >>> "a_b_c".rsplit('_', 1) ['a_b', 'c'] А что будет если оставить аргументы пустыми? >>> "a_b_c".split() ['a_b_c'] Получаем список с одним элементом, потому что по умолчанию используется пробельный символ. >>> "a b c".split() ['a', 'b', 'c'] То есть это равнозначно такому вызову? >>> "a b c".split(" ") ['a', 'b', 'c'] Кажется да, но нет! Давайте попробуем добавить пробелов между буквами >>> "a b c".split(" ") ['a', '', '', 'b', '', '', 'c'] И вот картина уже не так предсказуема 😕 А вот что будет по умолчанию >>> "a b c".split() ['a', 'b', 'c'] Всё снова красиво! 🤩 По умолчанию в качестве разделителя используется любой пробельный символ, будь то табуляция или новая строка. Включая несколько таких символов идущих подряд. А также игнорируются пробельные символы по краям строки. >>> "a\t b\n c ".split() ['a', 'b', 'c'] Аналогичный способ можно собрать с помощью регулярного выражения. Но пробелы по краям строки придется обрабатывать дополнительно. >>> import re >>> re.split(r"\s+", ' a b c '.strip()) ['a', 'b', 'c'] Здесь тоже можно указать количество разделений >>> re.split(r"\s+", 'a b c', 1) ['a', 'b c'] А что если мы хотим написать красиво, то есть split() без аргументов, но при этом указать количество разделений? В этом случае первым аргументом передаём None >>> "a\n b c".split(None, 1) ['a', 'b c'] Данный метод не учитывает строки с пробелами, взятые в кавычки 'a "b c" '.split() ['a', '"b', 'c"'] Но для таких случаев есть другие способы. #tricks#basic

Резултати

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

Пребарај: #debian

当前筛选 #debian清除筛选
Linuxgram 🐧

@linuxgram · Post #18737 · 10.05.2026 г., 22:11

📰 Debian Now Blocks Non-Reproducible Packages from Testing Debian now blocks non-reproducible packages from entering testing, making reproducible builds a migration requirement for the 14 (Forky) cycle. 🔗 Source: https://linuxiac.com/debian-now-blocks-non-reproducible-packages-from-testing/ #debian

Hashtags

Linuxgram 🐧

@linuxgram · Post #18733 · 10.05.2026 г., 11:49

📰 Debian Release Team: Debian Must Now Ship Reproducible Packages With half-way through the Debian 14 "Forky" development cycle, the Debian release team is out with an update this weekend and some big news... 🔗 Source: https://www.phoronix.com/news/Debian-Must-Ship-Reproducible #debian

Hashtags

Linuxgram 🐧

@linuxgram · Post #18717 · 09.05.2026 г., 06:48

📰 Pi-hole showed me 65,000 DNS queries in hours, and I didn't like where they were going Like most self-hosting enthusiasts, I also installed Pi-hole, implemented it network-wide, and moved on thinking it finally gave me control over my network along with a cleaner browsing experience. Running it on my Debian Docker setup already felt like a solid upgrade, and in no time it quietly embedded itself into my setup. Since it was implemented network-wide, every device on my network was already using it silently. 🔗 Source: https://www.xda-developers.com/pi-hole-showed-me-65000-dns-queries-in-hours-didnt-like-where-going/ #debian

Hashtags

Linuxgram 🐧

@linuxgram · Post #18650 · 02.05.2026 г., 10:27

📰 APT 3.3 Lands in Debian Unstable with CLI Versioning Support APT 3.3 package manager removes the long-standing unstable CLI warning and adds support for requesting a specific CLI version. 🔗 Source: https://linuxiac.com/apt-3-3-lands-in-debian-unstable-with-cli-versioning-support/ #debian

Hashtags

Linuxgram 🐧

@linuxgram · Post #18490 · 19.04.2026 г., 21:20

📰 New Debian Project Leader Elected For 2026 Sruthi Chandran has been elected the new Debian Project Leader "DPL" after running unopposed in this year's elections... 🔗 Source: https://www.phoronix.com/news/Debian-DPL-Sruthi-Chandran #debian

Hashtags

Linuxgram 🐧

@linuxgram · Post #18341 · 07.04.2026 г., 22:11

📰 Debian’s APT 3.2 Released with History, Undo, Redo, and Rollback Support APT 3.2 package manager for Debian-based distributions is now available with native rollback, undo, redo, and history features. 🔗 Source: https://9to5linux.com/debians-apt-3-2-released-with-history-undo-redo-and-rollback-support #debian

Hashtags

Linuxgram 🐧

@linuxgram · Post #18262 · 31.03.2026 г., 16:32

📰 Claude's new computer use feature turned my old laptop into a machine I control from my phone I’ve been running my homelab on an 8-year-old laptop as a bare-metal Debian server. I rarely interacted with it directly, though. At my desk, I used my PC, and everywhere else, I relied on my MacBook. My MacBook had become my main control hub for the homelab server and my NAS. I didn’t mind managing my server manually, but I did mind having to sit down every time. Even for a routine check, I had to log into my MacBook, either SSH into the server... 🔗 Source: https://www.xda-developers.com/claudes-computer-use-feature-turned-machine-control-from-phone/ #debian

Hashtags

Linuxgram 🐧

@linuxgram · Post #17910 · 26.02.2026 г., 21:23

📰 Debian 14 will drop Gtk2 – unless Ardour rides to the rescue Many dependent apps, including FreePascal and Lazarus, face the chop Version 2 of the widely used Gtk toolkit will be dropped from the next Debian release. The problem is that many things still need it, including FreePascal and its Lazarus IDE.… 🔗 Source: https://go.theregister.com/feed/www.theregister.com/2026/02/26/debian_14_will_drop_gtk2/ #debian

Hashtags

Linuxgram 🐧

@linuxgram · Post #17827 · 18.02.2026 г., 19:37

📰 Running Debian on the OpenWrt One With openwrt-one-debian, you can now install and run a full Debian system leveraging the OpenWrt One’s NVMe storage, enabling everything from custom services and containers to development tools and lightweight server workloads, all on open hardware. 🔗 Source: https://www.collabora.com/news-and-blog/news-and-events/openwrt-one-meets-debian.html #debian

Hashtags

Linuxgram 🐧

@linuxgram · Post #17815 · 17.02.2026 г., 20:35

📰 Why is Debian Called the Universal Operating System, Again? Debian's official tagline is "Universal Operating System". It's more than just a tagline: it's a deeper concept that underpins the very nature of Debian as a project. 🔗 Source: https://itsfoss.com/debian-universal-operating-system/ #debian

Hashtags

Solidot 纯净版

@SolidotR · Post #5373 · 12.05.2026 г., 08:54

Debian 将要求可复现构建 #Debian Debian 发布团队宣布 Debian 项目的软件包将要求可复现构建。发布团队将阻止迁移无法复现的新软件包,或者在可复现性上出现性能下降的现有软件包。对于可复现(reproducible)的具体含义,开发者指的是在 Debian 构建环境实例中进行构建。 https://lists.debian.org/debian-devel-announce/2026/05/msg00001.html https://lwn.net/Articles/1072314/

Hashtags

Solidot 纯净版

@SolidotR · Post #5059 · 20.04.2026 г., 09:00

Sruthi Chandran 当选为 DPL #Debian 2026 年 Debian 项目领导人(DPL)选举结束,唯一的候选人、来自印度的图书管理员 Sruthi Chandran 当选,她将于 4 月 21 日上任。Sruthi Chandran 从图书管理员转为自由软件爱好者和 Debian 开发者,自 2016 年以来一直参与 Debian 的 Ruby、JavaScript、Go 和字体软件包的开发,但近期开发不再活跃,她还是 Community Team 代表,Outreach 团队成员,DebConf Committee 成员。她希望能帮助提升 Debian 社区的多元性,推动多元性议题的讨论。 https://www.debian.org/vote/2026/vote_001 https://www.debian.org/vote/2025/platforms/srud

Hashtags

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