@djangoproject · Post #82 · 08.07.2016 г., 07:45
Welcome to the home of #wxPython, a blending of the wxWidgets C++ class library with the Python programming language. https://wxpython.org/
Hashtags
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
Пребарај: #wxpython
@djangoproject · Post #82 · 08.07.2016 г., 07:45
Welcome to the home of #wxPython, a blending of the wxWidgets C++ class library with the Python programming language. https://wxpython.org/
Hashtags
@djangoproject · Post #381 · 12.07.2017 г., 21:16
https://wxpython.org/what.php #wxPython is a #GUI toolkit for the Python programming language. It allows Python programmers to create programs with a robust, highly functional graphical user interface, simply and easily. It is implemented as a Python extension module (native code) that wraps the popular wxWidgets cross platform GUI library, which is written in C++.
@djangoproject · Post #83 · 08.07.2016 г., 07:46
http://wxglade.sourceforge.net/ Description #wxGlade is a #GUI#designer written in Python with the popular GUI toolkit #wxPython, that helps you create wxWidgets/wxPython user interfaces. At the moment it can generate Python, C++, Perl, Lisp and XRC (wxWidgets' XML resources) code. As you can guess by the name, its model is Glade, the famous GTK+/GNOME GUI builder, with which wxGlade shares the philosophy and the look & feel (but not a line of code). It is not (and will never be) a full featured IDE, but simply a "designer": the generated code does nothing apart from displaying the created widgets. If you are looking for a complete IDE, maybe Eric Python IDE, PyCharm, Code::Blocks or one of the many other IDE is the right tool. News
@djangoproject · Post #521 · 13.12.2017 г., 19:57
https://www.infoworld.com/article/3230202/python/6-essential-libraries-for-every-python-developer.html 6 essential libraries for every Python developer Whether you're compiling Python for speed, building native UIs for Python desktop apps, or refining existing Python code, these Python projects have you covered Python has seen wide adoption across industries and disciplines by dint of being easy to work with. But it has also been aided by a wealth of third-party projects—libraries, add-ons, and complementary development efforts—that extend the language to an ever widening range of use cases. #PyPy #CFFI(C Foreign Function Interface library) #PyInstaller #PBR(Python Build Reasonableness) #WxPython #Mypy