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

TGINSIGHT SIMILAR POSTS

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

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

Для тех кто пишет расширения на PyQt/PySide для CG-софтов. Когда я только начинал писать тулзы под Maya (тогда еще версия 2010-2011) мне приходилось ручками ставить PyQt4 под Maya. Даже написал мануалы по установке на своём сайте. Но потом стал доступен из коробки PySide и позже он обновится до PySide2. Для некоторых систем была поддержка PyQt5. И как простому разработчику поддерживать этот зоопарк? Ведь хочется чтобы тул работал на любой версии (вы тоже делали модуль что-то типа import_qt.py?😁) На помощь приходит проект Qt.py который поставил себе цель унифицировать использование Qt-биндингов вне зависимости от среды где запускается код. Те, кто давно пишут на Qt, скорее всего знают этот проект. Он стал стандартом для CG-индустрии и используется в топовых студиях и проектах. Qt․py помогает запускать один и тот же код на разных платформах с разными вариантами Qt-библиотек. Это может быть как интеграция в CG-софт, так и переносимость стендалонов между разными платформами с разными версиями Python. Я решил рассказать о некоторых особенностях работы с этой библиотекой. Сегодня о том, как установить и использовать Qt․py и что это вам даёт. Установка pip install Qt.py Чтобы начать использовать Qt․py в коде достаточно заменить импорт вашего варианта Qt-биндинга на Qt․py from [PySide|PyQt4|PySide2|PyQt5] import QtWidgets => from Qt import QtWidgets Теперь ваш код будет поддерживать любой вариант биндинга Qt в Python. При этом не потребуется использовать if-else конструкции под разные версии. Все вызовы теперь одинаковы. Всё что нужно сделать, это написать его по правилам PySide2. Именно эта версия была взята за основу. Приоритет импорта такой: 1. PySide2 2. PyQt5 3. PySide 4. PyQt4 Что именно загрузилось можно посмотреть в переменной __binding__ >>> import Qt >>> Qt.__binding__ 'PySide2' Приоритет имопрта можно изменить через переменные QT_PREFERRED_BINDING и QT_PREFERRED_BINDING_JSON. Причем под каждый проект оверрайды можно настраивать индивидеально. #qt#libs

Hashtags

Резултати

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

Пребарај: #internationalaffairs

当前筛选 #internationalaffairs清除筛选

🎙 Russia's Foreign Minister Sergey Lavrov’s interview with Marina Kim for the New World project (Moscow, November 14, 2024) Key talking points: #InternationalAffairs • Our main task now is to achieve all the goals formulated by President Vladimir Putin. You are aware of the West’s expectations. They are speculating about stopping the hostilities at a certain line and coordinating a truce, so that 10 years from now they will decide who Crimea and Donbass belong to. This is coffee cup reading. I won’t engage in it. We have our tasks, and we will fulfil them. • Our job is to assert and promote Russia’s interests in keeping with its Constitution as well as the objectives defined by President Vladimir Putin. This goes beyond Ukraine and applies to Russia’s Foreign Policy Concept in general. #USA • Washington can’t allow Russia to prove that it is a strong player and undermine the West’s reputation. They don’t care about Ukraine. They only care about their reputation. They decided that Ukraine should have a government they like and didn’t expect anyone to protest. Russia? It’s a big country but it must be brought down a peg. That is what this is about rather than the future of the Ukrainian people. They don’t care about people. • Sanctions have been imposed on over half of the world’s countries, even if they are not as drastic as those that have been adopted against Russia, the Democratic People’s Republic of Korea, Iran and Venezuela. The real reason behind the West’s current rage is that China is rapidly and confidently surging ahead of the United States. • We can see through what the Americans want. Sitting somewhere overseas, they believe that they are beyond the reach, while leaving it to Europe to overcome the challenges they face in terms of encouraging and arming Ukraine to fight Russia, as well as footing the bill for the Middle East tragedy. #Eurasia4You • God gave us one continent, and we share it. This continent possesses immense and, in fact, the biggest natural resources, while several millennia-old civilisations inhabit it. Failing to benefit from these competitive advantages would be a mistake. This is what the idea of building a Greater Eurasian Partnership is all about, and the EAEU, SCO and ASEAN have already taken the first steps in this direction. We are establishing ties and promoting dialogue. If we succeed in fulfilling the plans we have, the Greater Eurasian Partnership will offer a solid foundation and serve as an economic and transport backbone for what President Vladimir Putin called a new Eurasian security architecture. • There is a clear understanding that the Eurasian security architecture, just like the Greater Eurasian Partnership, must be open to all countries and continents, including Eurasia’s western part, even if so far the latter has been trying, as if by inertia, to ensure its interests within a Euro-Atlantic security concept instead of opting for the Eurasian framework, which would be natural and reasonable, considering the geography factor. This is their way of saying that they do not intend to do anything without the United States. #BRICS 🌐 BRICS is about the new world order that is based on the main principle of the UN Charter – the sovereign equality of states. • BRICS has no intention of dividing the world. It wants to bring together countries that desire closer relations so that they can live on the land they got from God and their ancestors just as they used to, as great civilisations. #Africa 🌍 Decolonisation has taken place, in a broad sense. But being able to actually manage one’s freedom and resources is a different story. This is where neo-colonialism comes to the fore. • The First Ministerial Conference of the Russia-Africa Partnership Forum in Sochi, and the Russia-Africa Summit in St Petersburg in 2023 clearly put into perspective the trends that could be called Africa’s second awakening.