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

Резултати

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

Пребарај: #infrastructuredevelopment

当前筛选 #infrastructuredevelopment清除筛选

विकास पथ को गति दे रहे भारत के राष्ट्रीय राजमार्ग।। 🛣️ भारत के सड़क नेटवर्क के विस्तार के साथ-साथ प्रगति की यात्रा का गवाह बनें। यह परिवर्तन वास्तव में #NewIndia की गति और विकास का प्रमाण है। #InfrastructureDevelopment #Highway

MyGov Newsdesk

@MyGovCoronaNewsdesk · Post #13234 · 07.08.2024 г., 15:44

Experience high-speed connectivity for industrial centres with the Nashik Phata – Khed Corridor! Enhancing travel between Pune and Nashik along NH-60, this corridor reduces congestion around Pimpri-Chinchwad, fostering industrial growth and smoother transportation. #InfrastructureDevelopment#NewIndia #TransformingIndia

MyGov Newsdesk

@MyGovCoronaNewsdesk · Post #13233 · 07.08.2024 г., 13:42

Guwahati's connectivity gets a major boost with the new Northern Guwahati Bypass! Upgrading the existing bypass and constructing a major bridge over the Brahmaputra, this project will significantly improve travel efficiency and support regional development. #InfrastructureDevelopment#NewIndia #TransformingIndia

MyGov Newsdesk

@MyGovCoronaNewsdesk · Post #13232 · 07.08.2024 г., 12:41

The Kanpur Ring Road project will complete the 6-lane National Highway Ring around Kanpur! Enhancing traffic flow and reducing congestion, this project is set to transform Kanpur’s connectivity, making travel within the city and to other regions smoother and faster. #InfrastructureDevelopment#NewIndia #TransformingIndia

MyGov Newsdesk

@MyGovCoronaNewsdesk · Post #13231 · 07.08.2024 г., 11:39

Boost industrial connectivity with the Pathalgaon & Gumla sections of the Raipur-Ranchi National High-Speed Corridor! Linking mining areas in Gumla, Lohardaga, Raigarh, Korba, and Dhanbad to industrial zones in Raipur, Durg, Bilaspur, and Bokaro, this project promotes faster, efficient transportation. #InfrastructureDevelopment#NewIndia #TransformingIndia

MyGov Newsdesk

@MyGovCoronaNewsdesk · Post #13230 · 07.08.2024 г., 09:38

Pilgrims can now reach Ram Mandir via the Ayodhya Ring Road! This project facilitates quicker movement for devotees visiting the sacred site, enhancing the spiritual journey and supporting regional tourism and infrastructure development. #InfrastructureDevelopment#NewIndia #TransformingIndia

MyGov Newsdesk

@MyGovCoronaNewsdesk · Post #13229 · 07.08.2024 г., 08:07

Ensure smooth freight movement with the Tharad – Deesa – Mehsana – Ahmedabad National High-Speed Corridor! This corridor links industrial regions in Punjab, Haryana, and Rajasthan to major ports in Maharashtra, enhancing logistics efficiency and boosting industrial growth. #InfrastructureDevelopment#NewIndia #TransformingIndia

MyGov Newsdesk

@MyGovCoronaNewsdesk · Post #13228 · 07.08.2024 г., 07:07

Unlock the North East with the Kharagpur-Moregram National High-Speed Corridor! Connecting West Bengal, Odisha, and Andhra Pradesh to the North-East, this project will increase traffic capacity by over 5 times, promoting regional development and improving travel efficiency across these states. #InfrastructureDevelopment#NewIndia #TransformingIndia

MyGov Newsdesk

@MyGovCoronaNewsdesk · Post #13227 · 07.08.2024 г., 06:06

Travel faster to iconic landmarks with the Agra-Gwalior National High-Speed Corridor! Enhancing connectivity to tourist hotspots like Taj Mahal, Agra Fort, and Gwalior Fort, this corridor will double traffic capacity and cut travel time by 50%. #InfrastructureDevelopment#NewIndia #TransformingIndia

MyGov Newsdesk

@MyGovCoronaNewsdesk · Post #13226 · 07.08.2024 г., 05:04

Experience seamless travel with 8 national high-speed road corridors spanning 936 km! With an investment of Rs 50,655 crore, these corridors are set to revolutionize connectivity and boost economic growth across India. #InfrastructureDevelopment#NewIndia #TransformingIndia

MyGov Newsdesk

@MyGovCoronaNewsdesk · Post #12823 · 12.07.2023 г., 09:10

India's National Highways - From Roadblocks To Road Wonders! Witness the wide ride of progress as India's road network expands, solidifying its position as one of the largest in the world. This transformation is truly a testament to #NewIndia's growth and development. #InfrastructureDevelopment #Highway