File: pint_quantity.py

package info (click to toggle)
magicgui 0.9.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 21,796 kB
  • sloc: python: 11,202; makefile: 11; sh: 9
file content (21 lines) | stat: -rw-r--r-- 503 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""# Quantities with pint

Pint is a Python package to define, operate and manipulate physical quantities:
the product of a numerical value and a unit of measurement.
It allows arithmetic operations between them and conversions
from and to different units.
https://pint.readthedocs.io/en/stable/
"""

from pint import Quantity

from magicgui import magicgui


@magicgui
def widget(q=Quantity("1 ms")):
    """Widget allowing users to input quantity measurements."""
    print(q)


widget.show(run=True)