Метод строки 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
#dart
You can watch live streams simply on multiple platforms like Huya, Douyu, Bilibili, and Douyin using an app called Simple Live. It works on Android, iOS, Windows, MacOS, Linux, and Android TV, though some versions are still in beta. The app is built with Flutter and includes features to get live video and chat messages (danmaku) from these sites. You need to compile the app yourself since no ready-made installer is provided. This gives you a lightweight, easy way to watch live broadcasts from popular Chinese streaming platforms on many devices without extra cost or ads.
https://github.com/xiaoyaocz/dart_simple_live
#dart
The Flutter Packages repository on GitHub holds the source code for official Flutter packages made by the core team, including popular ones like camera, google_maps_flutter, and shared_preferences, all available for use in your apps and also published on pub.dev for easy installation[4]. This means you get reliable, well-maintained tools for features like maps, user preferences, and device hardware access, helping you build apps faster and with less worry about bugs or compatibility issues. The benefit is that you can trust these packages for quality and support, and you can even help improve them by reporting issues or contributing code[4].
https://github.com/flutter/packages
РУКОТВОРНЫЙРОЙ НЕБЕСНЫХ ВАЛУНОВ
Это глубокий снимок двойного астероида Дидим-Диморф, полученный КТ "Хаббл" 19 дек. 2022 г., спустя 3 месяца после столкновения с ударником миссии DART.
Здесь, помимо яркого и узкого шлейфа выброшенной в ходе рукотворного катаклизма пыли, идентифицировано 37 крупных, от 1 до 7 м, валунов (отмечены кружками). Эти объекты - в числе самых маленьких и тусклых (видимый блеск от 26-й до 28-й зв. вел.) из когда-либо фотографировавшихся в Солнечной системе.
Это - не осколки удара; камни уже лежали на поверхности астероида, но были выброшены в космос энергией столкновения и отдаляются от материнского тела на скоростях ~30 см/с. Как отмечается в пресс-релизе НАСА, это можно сравнить со скоростью гигантской черепахи.
Миссия ЕКА "Hera", которая сблизится с системой в конце 2026 г., сможет сфотографировать эти валуны с близкого расстояния.
Научная статья с результатами
#DART#Hera#Dimorphos
🚀 Менторство по Flutter + AI
Делаем реальное AI-мобильное приложение. Полностью удалённо.
Языки: EN / УКР / RU
Что получите:
• Индивидуальное наставничество 1:1 с сеньорами
• Парное программирование, код-ревью, быстрый рост
• Сильный кейс в портфолио
• Перспектива обсудить оплачиваемую работу позже
Стек: Flutter/Dart, AWS, Git, Jira + Scrum
Условия: сейчас без оплаты (фокус на обучении и портфолио)
Как откликнуться — DM @glorymlory:
1. ваш @username
2. 2–3 предложения о текущем стеке/опыте (Flutter или смежное)
3. ваша недельная доступность (часы)
#Flutter#Dart#AI#Mentorship#Remote
#dart#capture_traffic#httpdebug#proxy#proxypin#zhuabao
ProxyPin is a free, open-source tool that lets you capture, inspect, and modify HTTP(S) traffic on many devices like Windows, Mac, Android, iOS, and Linux. It’s easy to use with a nice interface and supports features like scanning QR codes to connect devices without manual setup, filtering traffic by domain, searching requests, rewriting or blocking requests, and saving traffic history. You can also write JavaScript scripts to customize how requests and responses are handled. This helps you debug network issues, analyze app traffic (including Flutter apps), and improve security or performance efficiently across platforms[1][3].
https://github.com/wanghongenpin/proxypin
#dart#android#flutter#flutter_apps#manager#modding#patching#revanced
ReVanced Manager is an app for Android that lets you customize and patch other apps, like YouTube, to remove ads and add features without needing subscriptions. It is easy to use, works on both rooted and non-rooted devices, and offers many options to tailor apps to your liking. You download the official app, then apply patches you want, creating a personalized, ad-free experience. This saves you money and improves app use while staying legal and supported by an active community. It is lightweight, regularly updated, and has a simple interface, making app customization safe and convenient[1][3][5].
https://github.com/ReVanced/revanced-manager
#dart#android#cross_platform#expense_tracker#flutter#grocery_list#ios#kitchenowl#mobile_app#recipe_manager#self_hosted
KitchenOwl is a helpful app for managing your grocery shopping and recipes. It allows you to create and share shopping lists with others, which is great for families. You can also store and share recipes, plan meals, and track how much you spend. The app is open-source and free, meaning you can use it without paying and even help improve it. It works on many devices, including phones and computers, and can be used offline too. This makes shopping easier and helps you stay organized.
https://github.com/TomBursch/kitchenowl
#dart#clash#clashmeta#ech#hysteria#hysteria2#proxy#reality#shadowsocks#shadowtls#sing_box#singbox#ssh#tuic#v2ray#vless#vmess#wireguard#xray
Hiddify is a free, ad-free, open-source proxy VPN app for Android, iOS, Windows, macOS, and Linux. It uses Sing-box to support protocols like Vless, Reality, Hysteria, TUIC, WireGuard, and SSH, with auto node selection by delay, subscription updates, TUN mode, and traffic info. Download from app stores or GitHub. It benefits you by providing secure, fast, private internet access to bypass restrictions in places like Iran or China, ensuring unrestricted browsing without costs or ads.
https://github.com/hiddify/hiddify-app