Для тех кто пишет расширения на 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
#Russia denies of recruiting #Kenyan citizens for war in #Ukraine
The Embassy of the Russian Federation in Kenya has rejected allegations that it was involved in recruiting Kenyan citizens to fight in the conflict in Ukraine, describing the claims as part of a “dangerous and misleading propaganda campaign.”
In a press release issued on February 19, the embassy said it had observed with “great concern” reports circulating in Kenyan media and public discourse regarding Kenyan nationals who allegedly traveled to Russia, joined the Armed Forces of the Russian Federation, and participated in combat operations in Ukraine.
The statement comes after an intelligence official briefing presented to Kenya’s Parliament reported that 89 Kenyans were confirmed on the front line, 39 were hospitalized, and 28 were missing in action.
https://addisstandard.com/?p=55260
Shipping disruptions strand 8 million kg of #Kenyan tea in #Mombasa as #US-#Israel war with #Iran hits exports
Disruptions to global shipping routes linked to the ongoing war between the United States, Israel, and Iran have left nearly eight million kilograms of tea stranded in warehouses in Mombasa, threatening export earnings and farmer incomes, according to the East Africa Tea Traders Association.
George Omuga, managing director of the association that runs the Mombasa tea auction, told Reuters that losses have been accumulating at roughly $8 million per week since 01 March.
“The current conflict in the Middle East has had a direct impact, a negative impact on this auction,” Omuga said, noting that no tea shipments were currently leaving for Middle Eastern markets, which account for 20–25% of Kenya’s tea exports.
https://x.com/addisstandard/status/2039378986518626404?s=20
News: #IMF-backed forex reforms cost #Ethiopia $2.6 billion in central bank losses
Ethiopia’s central bank, the National Bank of Ethiopia (#NBE), has recorded losses equivalent to $2.6 billion following the country’s shift from a fixed to a market-based foreign exchange regime in July 2024, according to audited financial statements cited by the #Kenyan outlet The EastAfrican.
NBE said it incurred 407.1 billion birr in foreign exchange losses during the financial year ending June 30, 2025, largely due to the revaluation of its foreign currency assets and liabilities after the exchange rate realignment. Foreign exchange losses rose sharply to 445.23 billion birr, from 38.13 billion birr the previous year.
The surge pushed the National Bank of Ethiopia’s overall operating loss to 428.56 billion birr, up from 10.51 billion birr a year earlier, and drove the Bank into a negative equity position of 380 billion birr, raising concerns over its ability to continue...
Read more: https://addisstandard.com/?p=54706
#UN envoy meets RSF leader in #Nairobi to discuss de-escalation in #Sudan
The United Nations Personal Envoy for Sudan, Pekka Haavisto, met with Rapid Support Forces (#RSF) commander Mohamed Hamdan “Hemetti” Dagalo in Nairobi on Monday to discuss practical avenues for de-escalation.
The meeting in the #Kenyan capital is part of Haavisto’s inaugural regional tour. It follows recent discussions in Khartoum with the President of the Transitional Sovereign Council, General Abdel Fattah al-Burhan, as the UN seeks to mediate an end to the nearly three-year-old conflict.
UN spokesperson Stéphane Dujarric described the talks as a “constructive opportunity” to exchange views on protecting civilians. He noted that all stakeholders engaged by Haavisto have expressed readiness to cooperate with the world body.
“This is encouraging and must swiftly translate into concrete progress towards ending.....
https://www.facebook.com/AddisstandardEng/posts/pfbid0KVXwXxdPxbctPJpW5qK7Kwkw63bPeXrmU7q7Bjab37CvbqfZT7SuvSHFZqa4GrN2l