Модуль Qt․py это не просто текстовый модуль, его компоненты генерируются на лету в зависимости от ситуации.
Поэтому ваша любимая IDE не сможет качественно сообразить автокомплиты под этот модуль.
Решение здесь более чем очевидно, надо сделать stubs-файлы. Это файлы с расширением .pyi, описывающие содержимое модуля но не имеющие рабочего кода.
Ну что, готовы потратить пару месяцев своей жизни чтобы описать все классы Qt и их методы? 😭
Расслабьтесь, за вас это уже сделали добрые люди.
Спасибо Fredrik Averpil !
Качаем здесь ⬇️
https://github.com/fredrikaverpil/Qt.py/tree/stubs/stubs/Qt
Не думаю что стоит устанавливать Qt․py из этого репозитория. Он там не обновляется. Так что забираем только файлы .pyi.
За актуальность этих файлов тоже не ручаюсь, но большинство методов там имеются.
Установка:
🔸 Вариант 1:
- находим куда установлен сам модуль Qt․py, это будет одинокий файл который так и называется Qt․py
- кидаем директорию рядом с ним (если есть доступ на запись). Должно получиться так:
📁 site-packages\
📄 Qt.py
📁 Qt\
...
🔸 Вариант 2
- копируем директорию Qt куда угодно
- пробиваем путь к ней в настройках энвайронмента в переменную PATH так, чтобы путь был ДО директории Qt.
Закинуть можно и в свою домашнюю директорию. Если скопируете сюда:
~/stubs/Qt
То переменную пишем так
export PATH=~/stubs:${PATH}
После этого IDE должна распарсить stubs-файлы и автокомплиты появятся 😎
#qt#libs#tricks
https://mborgerson.com/creating-an-executable-from-a-python-script/
Creating an Executable from a Python Script
Python is one of my favorite programming languages. That being said, if you've ever had to deploy an application written in Python then you know just how painful it can be.
#PyInstaller
http://www.pyinstaller.org/
#PyInstaller is a program that #freezes (#packages) Python programs into #stand_alone#executables, under Windows, Linux, Mac OS X, FreeBSD, Solaris and AIX. Its main advantages over similar tools are that PyInstaller works with Python 2.7 and 3.3—3.5, it builds smaller executables thanks to transparent compression, it is fully multi-platform, and use the OS support to load the dynamic libraries, thus ensuring full compatibility.
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