Examples#

Calculator#

It’s easy to create a good-looking program with Edifice. In this example, we imitate the look of the MacOS Calculator app in 100 lines of code (most of which is implementing the calculator state machine).

The code is available at calculator.py.

_images/example_calculator.png
Run in Python environment#
python examples/calculator.py
Run in Python environment with Edifice Runner#
python -m edifice --inspect examples/calculator.py Main
Run with Nix#
nix run github:pyedifice/pyedifice#example-calculator

Financial Charting#

In this example, we create a reactive charting application with Edifice which fetches stock data from Yahoo Finance.

The code is available at financial_charts.py.

_images/example_financial_charting4.png
Run in Python environment#
python examples/financial_charts.py
Run in Python environment with Edifice Runner#
python -m edifice --inspect examples/financial_charts.py Main
Run with Nix#
nix run github:pyedifice/pyedifice#example-financial-charting

TodoMVC#

An implementation of TodoMVC in Edifice.

TodoMVC is a simple todo list program written in many JavaScript frameworks, so that web developers can compare the frameworks by comparing the TodoMVC implementations.

For comparison, the Edifice TodoMVC program is available at todomvc.py.

_images/example_todomvc.png
Run in Python environment#
python examples/todomvc.py
Run in Python environment with Edifice Runner#
python -m edifice --inspect examples/todomvc.py Main
Run with Nix#
nix run github:pyedifice/pyedifice#example-todomvc

Harmonic Oscillator#

An example of animation in Edifice.

The code is available at harmonic_oscillator.py.

_images/example_harmonic_oscillator2.png
Run in Python environment#
python examples/harmonic_oscillator.py
Run in Python environment with Edifice Runner#
python -m edifice --inspect examples/harmonic_oscillator.py Main
Run with Nix#
nix run github:pyedifice/pyedifice#example-harmonic-oscillator