Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 594 Bytes

Readme.md

File metadata and controls

29 lines (20 loc) · 594 Bytes

SduPy - Simple Declarative Ui for Python

Example

import numpy as np

import sdupy
from sdupy import vis, reactive

sdupy.window("sdupy example - sine")

x = np.arange(0, 1, 0.001) * np.pi * 2
freq = vis.slider("frequency", min=0.1, max=10, value=2, step=0.1)
amp = vis.slider("amplitude", min=0.1, max=10, value=2, step=0.1)
vis.plot_mpl("sine", x, amp * reactive(np.sin)(freq * x))

sdupy.run_mainloop()

screenshot

$ python3 examples/sine.py

Guide