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

Резултати

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

Пребарај: #package

当前筛选 #package清除筛选
djangoproject

@djangoproject · Post #209 · 19.12.2016 г., 19:21

http://stackoverflow.com/questions/7110604/standard-way-to-create-debian-packages-for-distributing-python-programs My final goal should be that of creating a "binary" .deb package. Such package will be platform independend (32/64 bit) as all python programs are such. To create a "binary" #package I need first to create a source package. To create the source package I can use either CDBS or debhelper. Debhelper is the recommended way for beginners. The core of creating a source package is populating the DEBIAN directory in the source directory with a number of files clarifying where files need to be copied, what copyright and licensing scheme they are subject to, what dependencies they have, etc... Step #4 can be largely automated the dh_makecommand if the python source also comes with a distutils' setup.py script.

Hashtags

BotzHub

@botzhub · Post #140 · 10.08.2021 г., 14:23

@HTMLWebShotBot #repo - GitHub #package - PyPI - Send a URL to get the screenshot of that webpage. - Send a .html file to get a screenshot of how it would appear on the web. Do follow me onGitHub, 200 soon🎉 ~ @BotzHub

BotzHub

@botzhub · Post #92 · 08.06.2021 г., 14:37

@DetectProfanityBot #repo - GitHub #package - PyPI - This bot can delete messages containing abuses from your group. - Add the bot to your group and make it admin, and it'll keep your group clean from abuses. - Group privacy is enabled. The bot has to be made admin in the group, for it to filter abuses. - False positives can be removed, if reported in the chat. ~ @BotzHub

Numonov.co

@numonovdesign · Post #251 · 06.12.2023 г., 14:15

#package#nasrsnack ✅Brend nomi: NASR ⚠️Vazifa: Package design ❇️Dizayner: No'monov Sherali ➡️Murojaat uchun: @richshax Frilansus.com platformasi bilan hamkorlikda ishlandi. Variyant tasdiqlanmadi❌

Valisher Botirov | Development

@valisherbotirov · Post #234 · 12.04.2024 г., 18:25

Kerakli package va kutubxonalarni ulashib borishda davom etamiz! Vue js yordamida slider qilmoqchi bo'lganlar uchun sodda package. Swiper js kabi murakkab fungiyalarga ega emas. Lekin kichikroq proyektlarda bemalol ishlatsa bo'ladi. Install qilish va ishlatish juda sodda tarzda berilgan. 📔 Ishlatib ko'rish uchun #vue#package ☑️@valisherbotirov

Hashtags

AyuCLouD-Services 公告频道

@AyuCloud_News · Post #286 · 24.09.2021 г., 08:00

#套餐结构调整通知 由于当前所有线路升级为:内网中转,成本大幅上涨 我们将最迟在10月上旬完成对套餐结构调整(主要针对流量和价格的中幅度调整) AyuCLouD-Services 运营团队 敬上! #Package structure adjustment notice As all current lines are upgraded to: intranet transfer, the cost has risen sharply We will complete the adjustment of the package structure by early October at the latest (mainly for medium-range adjustments in traffic and prices) Sincerely, AyuCLouD-Services Operation Team!

djangoproject

@djangoproject · Post #211 · 19.12.2016 г., 19:37

http://www.debian.org/doc/packaging-manuals/python-policy/ch-python.html At any given time, the binary #package python3 will represent the current default #Debian Python 3 version; the binary package python will represent the current default Debian Python 2 version. As far as is reasonable, Python 3 and Python 2 should be treated as separate runtime systems with minimal interdependencies.

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