Live coding for Python, Qt and QML
Project description
Live Coding Environment for Python, Qt and QML
This project provides a live coding environment for Python and Qt. It supports both PyQt and Qt for Python (PySide2) via the python_qt_binding.
Install
To install the live coding environment run:
python setup.py install
or install it via pip
pip install python-qt-live-coding
You also need to install PyQt or PySide2 for this application to work. The quickest way to achieve this is to use pip.
pip install PyQt5
or
pip install pyside2
Use
The live coding environment comes with a live runner which enables your to live code Qt GUIs quickly.
Run following to test drive the example:
python_qt_live_coding examples
Your will instantly see the example project in the live runner.
Now you can either select the MainScreen.qml
file or type MainScreen
in the filter.
When you type, the file will be automatically selected.
When loaded you will see following.
This is the example GUI inside the live runner.
Now press the Edit
button. Your favorite text editor should open promptly.
Edit the code inside the editor und you will see the GUI updates instantly when you save the document.
Python QML module support
The live coding environment has built in support for Python QML modules.
The idea is to place QML and Python code in the same directory, similar to how you would create a Qt/C++ application. Additionally, with Python we have the advantage of being able to discover modules automatically.
For this purpose add register_qml_types
function to the __init__.py
of your Python QML module.
See the example in example/module/__init__.py.
However, so far automatic reloading of Python code is not support.
When you work on a Python module please use the Restart
button which restarts the live coding application instead.
Forcing PyQt or Python for Qt (PySide2) usage
In some cases you might want to force which Python Qt binding python_qt_live_coding
is using.
This can be done by passing the optional --binding
argument via the command line.
python_qt_live_coding -b pyside .
PyCharm Support
For this application to work with PyCharm and other IntelliJ IDEs please disable the "safe write" feature. The feature writes a temporary file before saving any file, which can confuse the file change watcher.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for python-qt-live-coding-0.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fff6c92f3c59bb10676cd6764d6c77cb5e0653bd00c20d9fbff7f8b6696ce6f3 |
|
MD5 | be00a6df0f4146296506c2354aba8caf |
|
BLAKE2b-256 | 78e7cab57df26600ad89705b034d6793aaadf3e9d32d7aef8040b99627836123 |