Для тех кто пишет расширения на 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
#video#Libya
The civil war in Libya has left the country littered with unexploded mines, bombs and other explosive devices. Clearing the dangerous war remnants rests on the shoulders of ordinary people like school teacher Mahmoud.
Watch Mine Country on our website and Odysee to find out more about the grim legacy of Libya’s civil war.
Follow: https://t.me/rtdocumentary
Migrants in Libya fearful after crackdown and killings
Hundreds of migrants and refugees waited outside a United Nations center in Tripoli to seek help in escaping Libya after what aid groups called a violent crackdown in which thousands were arrested and several shot.
#News#Reuters#Libya
Subscribe: http://smarturl.it/reuterssubscribe
Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled.
Get the latest news on: http://reuters.com/
Follow Reuters on Facebook: https://www.facebook.com/Reuters
Follow Reuters on Twitter: https://twitter.com/Reuters
Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en
➖@reutersworldchannel➖
🇱🇾🇹🇷 Глава разведки западного правительства Ливии посетил Турцию – всего через неделю после аналогичного визита Саддама Хафтара.
Директор Департамента военной разведки сил Правительства национального единства (ПНЕ) и командующий 444-й оперативной бригадой Махмуд Хамза (на фото красивый с бородой) посетил Турцию с официальным визитом по приглашению турецкого правительства. В Анкаре его приняли начальник Генштаба Турции, его заместитель и глава военной разведки.
«В ходе визита состоялись обширные обсуждения путей укрепления безопасности и военного сотрудничества между двумя странами с упором на программы обучения, наращивание потенциала и повышение компетентности личного состава ливийской армии в различных специальностях», - сообщают ливийские СМИ.
Ливийская делегация также посетила заводы по производству самолетов и беспилотников и некоторые авиационные объекты. Визит Хамзы в Турцию состоялся через несколько дней после визита Саддама Хафтара в Анкару, где тот встретился с командующим Сухопутных войск Сельджуком Байрактаром.
#Ливия#Libya
🇱🇾#Ливия🇺🇸#США
Командующий Африканским командованием США генерал Лэнгли и председатель Объединенного комитета начальников штабов США генерал Браун завершили консультации с начальниками генеральных штабов востока и запада Ливии генералами Аль-Надури и Аль-Хаддадом на полях конференции начальников штабов африканских стран 2024 года в Габороне (Ботсвана).
Согласно официальному заявлению, США полностью поддерживают предложенные ливийской стороной решения по объединению армии и укреплению ливийского суверенитета.
Вашингтон подтвердил приверженность укреплению сотрудничества в области безопасности с профессиональными ливийскими военными всех регионов страны, чтобы построить стабильную и единую Ливию в интересах ливийского народа.
#Libya#Африка#США
Amid Records and Deepwater Exploration: Russia Considers Entry into Libyan Oil and Gas Projects
Libyan authorities and Russian partners are discussing expansion of its companies' participation in oil and gas projects, including exploration, production, and refining. This was announced following a meeting between Russian Ambassador Aidar Aganin and the Minister of Oil and Gas of the National Unity Government.
Russia's interest in Libya coincides with a key moment: in 2025, the country, having produced a record 1.37 million barrels per day, regained its status as Africa's second oil giant after Nigeria.
At the same time, production recovery is not the only trend. The industry is increasing gas capacity for the domestic market and preparing for a strategic breakthrough—the country's first-ever deepwater exploration in the Gulf of Sirte. Drilling the first well at a depth of approximately 1,900 meters, scheduled for early 2026, will open access to potentially rich offshore resources.
Thus, Libya offers foreign partners a window of opportunity at two levels: participation in the restoration and optimization of existing infrastructure and, more importantly, entry into a fundamentally new deepwater frontier during its development phase. For the Russian companies, this is a chance to gain a foothold in a restored market with unique long-term assets.
#AREA#Libya#RussiaAfrica
🇱🇾#Ливия🇺🇸#США
ExxonMobil подписала меморандум о взаимопонимании с Национальной нефтяной корпорацией Ливии для проведения «подробных геологических и геофизических исследований с целью выявления углеводородных ресурсов на четырёх морских блоках, расположенных у северо-западного побережья и в бассейне Сирта».
#USA#Libya
#Op_ed: Independence Veiled by Dictatorship: Isaias Afwerki’s #Eritrea on familiar autocratic path
In this op-ed, Abdirezak Sahane Elmi argues that many liberation movements eventually mirror the autocracies they overthrew. He notes that from #Libya to #Syria, leaders who dismantled unjust orders ultimately "subordinated national interests to regime survival," resulting in social fragmentation.
Elmi contends that Eritrea’s Isaias Afwerki follows this path, maintaining power through "engineered poverty." He warns that "the core danger of autocratic rule is not merely repression, but the way it reshapes political culture into one that prioritizes the survival of a leader over the survival of a nation."
The author underscores, "Liberation without institutional restraint and democratic governance does not safeguard freedom; it merely postpones the moment when power turns inward."
https://addisstandard.com/?p=55375
🇳🇮🇺🇸🇱🇾Libya orders arrest of airline official over transport of migrants to Nicaragua
Libyan authorities on Monday ordered the arrest of an airline official on charges of helping to illegally transport migrants to the United States via Nicaragua.
The commercial director of Ghadames Air was under investigation for "committing an activity harmful to the interests of the country," said a statement from the Tripoli-based Attorney General's office, which did not name the suspect.
It said Ghadames Air had transported hundreds of people to the Central American country of Nicaragua, who intended to then illegally enter the United States.
🔎Source
#US#Nicaragua#Libya
☠️ Blood Meridian