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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #164 · 14 окт.

🙄Разминка для ума! Треугольник Серпинского, интересная фигура которую построить достаточно просто. Алгоритм такой: 1. создаём любые 3 точки на плоскости 2. из этих точек случайно выбираем любую, как начальную 3. случайно выбираем любую точку из этих же трёх точек как цель 4. перемещаемся в сторону цели на половину расстояния 5. повторяем бесконечно с пункта 3 Если сделать достаточно много итераций то вырисовывается интересная фигура. Треугольник, в который вписаны более мелкие треугольники. Это самый настоящий фрактал! Я собрал пример построения такой фигуры на базе Qt. 🌎 Код можно посмотреть здесь. С помощью paintEvent я рисую точки по озвученному алгоритму. Каждые 10 секунд либо по клику на виджете строится следующий треугольник. Особенности примера: 🔸 Атрибут Qt.WA_OpaquePaintEvent позволяет сохранить то, что было нарисовано в прошлой итерации. Таким образом мы видим постепенное наполнение точек а не мелькающую одну точку. 🔸QTimer позволяет создавать отложенные вызовы один раз или с повторением через интервал. 🔸QColor.fromHsv() позволяет создать рандомный но предсказуемый цвет с помощью HSV схемы. Не слишком светлый и не слишком тёмный но всегда с разный. Рандомизации подвергается только смещение по цветовому кругу (Hue), яркость (Value) и насыщенность (Saturation) можно контролировать отдельно в своих пределах или оставить статичными. Обычный рандом цвета по RGB не даёт такой предсказуемый результат. 🔸 Каждый новый цикл с новым треугольником предварительно затемняет предыдущие через этот вызов painter.fillRect(rec, QColor(0, 0, 0, 100)) То есть полупрозрачный цвет. Таким образом, чем старше треугольник, тем он темней. Если сделать виджет фулскрин, то у нас получится некий ScreenSaver))) 🔸 Да, я знаю, что рисование в Qt не самый лучший способ сделать этот пример) Скорее всего самый НЕподходящий. Попробуйте сделать тоже самое но другими средствами. #qt#source#tricks

Резултати

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

Пребарај: #xml

当前筛选 #xml清除筛选
help florin закрыт

@HELPFLORIN · Post #6490 · 20.02.2023 г., 00:43

𖥻 🍵 ›› ֗ . . ✦ › › xml by @korolevalalin ➫ 𝘁𝗮𝗴𝘀 — #xml (ⲃ ⲕⲟⲙⲙ.)) `` взяⲗυ ♡゙ — ‹ + › ⲃ ⲕⲟⲙⲙ.

Hashtags

help florin закрыт

@HELPFLORIN · Post #6291 · 06.02.2023 г., 22:01

𖥻 🍵 ›› ֗ . . ✦ › › xml by @korolevalalin ➫ 𝘁𝗮𝗴𝘀 — #xml (ⲃ ⲕⲟⲙⲙ.)) `` взяⲗυ ♡゙ — ‹ + › ⲃ ⲕⲟⲙⲙ.

Hashtags

ALL About RSS

@AboutRss · Post #776 · 21.08.2020 г., 07:30

#教程 「Building a web scraping tool with Python」 6月发出第一篇的信息爬取系列教程终于在八月完结,其中第一篇讲如何用 #Python 解析 #XML 格式的 RSS feed。总共有三篇: 1️⃣Building an RSS feed scraper with Python 2️⃣Automated web scraping with Python and Celery 3️⃣Making a web scraping application with Python, Celery, and Django https://codeburst.io/building-an-rss-feed-scraper-with-python-73715ca06e1f 发现于 https://twitter.com/RSSCircus/status/1271810732225593346 题图来自 DataCamp。

Oneplus 13 Updates

@OnePlus13Series · Post #369 · 15.01.2026 г., 09:19

LM.CCD config adapted for OnePlus 13 ⬇️ Download Gcam App (pick aweme variant) What's Working : Main, Telephoto, Selfie, UW, Night Sight, Portrait, Videography (4k 60fps + Stabilization) Changelogs : • Based on LM.CCD_v3_Sabre config by LaoMa • Upscaling is enabled by default for Selfie Camera • Removed extra profiles (which i felt useless) • Miscellaneous small tweaks done by me. XML (.agc) Save Directory: /Download/AGC 9.2/configs All credit goes to the original creator of the config. #gcam#xml#agc 👤 Adapted by: @pulkittg 🔔 Updates: @OnePlus13Series 💬 Discussion: @OnePlus13SeriesChatRoom

djangoproject

@djangoproject · Post #547 · 14.01.2018 г., 21:44

https://stackoverflow.com/questions/3224268/python-unicode-encode-error Python #Unicode#Encode Error I'm reading and parsing an Amazon #XML file and while the XML file shows a ' , when I try to print it I get the following error:

djangoproject

@djangoproject · Post #408 · 10.08.2017 г., 10:42

https://docs.python.org/3/library/xmlrpc.html #XML-#RPC is a #Remote_Procedure_Call method that uses XML passed via #HTTP as a transport. With it, a #client can call methods with parameters on a remote server (the #server is named by a URI) and get back structured data. #xmlrpc is a package that collects server and client modules implementing XML-RPC. The modules are: xmlrpc.client xmlrpc.server

djangoproject

@djangoproject · Post #551 · 23.01.2018 г., 16:28

http://lxml.de/ #lxml is the most feature-rich and easy-to-use library for processing #XML and #HTML in the Python language. The lxml XML toolkit is a Pythonic binding for the #C libraries #libxml2 and #libxslt. It is unique in that it combines the speed and XML feature completeness of these libraries with the simplicity of a native Python #API, mostly compatible but superior to the well-known ElementTree API. The latest release works with all #CPython versions from 2.6 to 3.6. See the introduction for more information about background and goals of the lxml project. Some common questions are answered in the FAQ.