All Projects → ac1235 → Python Quickui

ac1235 / Python Quickui

Licence: mit
Scientific One-Liner Interactive GUI Library

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Python Quickui

Stdlib
✨ Standard library for JavaScript and Node.js. ✨
Stars: ✭ 2,749 (+1696.73%)
Mutual labels:  library, science
cplot
🌈 Plot complex functions
Stars: ✭ 75 (-50.98%)
Mutual labels:  science, matplotlib
pymae
Materials for the book "Python for Mechanical and Aerospace Engineering"
Stars: ✭ 56 (-63.4%)
Mutual labels:  tkinter, matplotlib
Alchemlyb
the simple alchemistry library
Stars: ✭ 52 (-66.01%)
Mutual labels:  library, science
Scipy-Bordeaux-2017
Course taught at the University of Bordeaux in the academic year 2017 for PhD students.
Stars: ✭ 16 (-89.54%)
Mutual labels:  science, matplotlib
Matplotlib Scalebar
Provides a new artist for matplotlib to display a scale bar, aka micron bar.
Stars: ✭ 58 (-62.09%)
Mutual labels:  science, matplotlib
Cmasher
Scientific colormaps for making accessible, informative and 'cmashing' plots
Stars: ✭ 149 (-2.61%)
Mutual labels:  matplotlib
Show Case Card View
Show case card view
Stars: ✭ 151 (-1.31%)
Mutual labels:  library
Plotbitrate
FFProbe Bitrate Graph
Stars: ✭ 148 (-3.27%)
Mutual labels:  matplotlib
Msvsearch
Material Search View
Stars: ✭ 148 (-3.27%)
Mutual labels:  library
Aerogameframework
AeroGameFramework is a Roblox game framework that makes development easy and fun. The framework is designed to simplify the communication between modules and seamlessly bridge the gap between the server and client.
Stars: ✭ 150 (-1.96%)
Mutual labels:  library
Routeros Api Php
Mikrotik RouterOS API PHP client for your applications
Stars: ✭ 152 (-0.65%)
Mutual labels:  library
Library Template Android
A Kotlin + Android library template (with a sample project).
Stars: ✭ 151 (-1.31%)
Mutual labels:  library
Swipelayout
A library what allows you to execute a swipe for the android platform
Stars: ✭ 150 (-1.96%)
Mutual labels:  library
Layerjs
layerJS: Javascript UI composition framework
Stars: ✭ 1,825 (+1092.81%)
Mutual labels:  library
Libwire
User space threading (aka coroutines) library for C resembling GoLang and goroutines
Stars: ✭ 149 (-2.61%)
Mutual labels:  library
Weihanli.common
common tools,methods,extension methods etc... .net 常用工具类,公共方法,常用扩展方法等,基础类库
Stars: ✭ 152 (-0.65%)
Mutual labels:  library
Arduino Libs
Arduino Libs & Examples: ADS1147, ADS7846, DAC8760, DS1307, RV8523, MCP2515, WS2812, S65-Display, MI0283QT-2/-9/-11, HX8347D, ILI9341, SSD1331
Stars: ✭ 148 (-3.27%)
Mutual labels:  library
Fos
Web Components to turn your web app into a fake operating system
Stars: ✭ 151 (-1.31%)
Mutual labels:  library
Libcache
A Lightweight in-memory key:value cache library for Go.
Stars: ✭ 152 (-0.65%)
Mutual labels:  library

Python QuickUI

QuickUI is a GUI toolkit and UI library wrapper around TkInter and Matplotlib for interactive one-liner toplevel UIs. It encourages scientists and developers to experiment and prototype using full fledged GUI applications. The length of programs QuickUI is designed for are basically simple one-liners entered into a REPL, thus it is possible to generate well structured and modern looking GUI windows in just a single line of code. Also, the standard Python 3 REPL and IPython both automatically display a QuickUI application without the need to explicitly state a "show-ui" command. Even though QuickUI excels at interactive one-liner experiences, it can also be used to build more complex production-ready applications and is highly extendable.

Example

Code

>>> import numpy as np
>>> from quickui import *
>>> forall(a = slider(1,10,0.1), b = slider(1,10,0.1)).show(
...    plot(lambda a,b: [np.arange(1,10), np.sin(np.arange(1,10)**a) + b/a]))

Output

Documentation

Basic Application Structure

The QuickUI API is built to fit into one line of code, therefore the structure of an application is utterly concise.

Each UI begins with a forall declaration stating which variables are defined to be represented by which GUI component.

forall(varname = input_widget, ...)

A single forall statement is enough to represent a whole GUI application consisting only of inputs. When __repr__ is called on a QuickUI object, the GUI automatically displays. This behavior was set, so that the interactive toplevels instantly show UIs.

Alternatively, the display_ui method can be called without arguments to show the GUI object. This behavior is needed when writing scripts using QuickUI.

After the forall call, the show method can be invoked with several output widgets attached to it.

forall(
  varname = input_widget,
  ...
).show(
  output_widget,
  ...
) # optionally: .display_ui()

Each output widget takes a callback function as an argument taking every single "foralled" variable as an argument.

output_widget_constructor(lambda var1, var2, ... : ...)

InputWidget

Each InputWidget subclass defines a method with the following API:

  • self.do_your_thing(tk_root_widget, my_name, state)

Where state represents a QuickUIState object.

From within this method, the object should invoke state.put_silent(my_name, initial_value) to set the initial value of the variable assigned to the InputWidget.

Then the TkInter callbacks should invoke state.put(my_name, updated_value) to change not only the variable silently, but to allow OutputWidgets to react to that state change.

Subclasses

  • slider(start, end, steps = None)
  • entry(type, default = None)

OutputWidget

Each OutputWidget subclass defines two methods with the following API:

  • self.init_ui(tk_root_widget)
  • self.update(variable_dict)

The init_ui method should be used to set up TkInter widgets, whereas from within update the state of those widgets should be changed with respect to the passed variable dictionary containing varname/current_value pairs.

Subclasses

  • label(lambda *vars: string)
  • plot(lambda *vars: [xaxis, yaxis])
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].