Skip to main content

Simple dialog windows for scripters and scientists.

Project description

Limited Interaction

import limitedinteraction as li

li.button_dialog("Simple dialog windows for scripters and scientists.",
                 choices=['OK'],
                 title='Limited Interaction',
                 icon='light')

message_calculating_macOS

This python module provides simple, generic dialog windows specifically aimed to scripters and scientists who need a concise, elegant way of interacting with their script users.

This module does not require any GUI programming, it has no external dependency, and it is completely independent of the graphical backend in use (if any). In IPython-based environments, its blocking functions allow interacting with Matplotlib figures while waiting for user action.

For those transitionning from Matlab, this module fulfils the same role as Matlab's msgbox, inputdlg, menu and other simple GUI functions.


Home page       GitHub       Issue tracker       API


Installing

Using pip:

pip install limitedinteraction

Using conda:

conda install -c conda-forge limitedinteraction

Usage

Importing

import limitedinteraction as li

Creating a persistent message window

li.message('Please wait a few moments.',
           title='Calculating...',
           icon='clock')

message_calculating_macOS

This is a non-blocking function. Any code after this call is executed immediately, while this message window stays in foreground. To close the message window:

li.message('')

Asking for user input

name = li.input_dialog('What is your name?', icon='question')

input_dialog_name_macOS

This is a blocking function. We wait for user input before continuing. Meanwhile, Matplotlib's event loop is refreshed so that the user can interact with figures.

This same function can have several inputs and some inputs can be masked:

credentials = li.input_dialog('Please enter your credentials',
                              labels=['Username:', 'Password:'],
                              initial_values=['username', 'password'],
                              masked=[False, True],
                              icon='lock')

input_dialog_credentials_macOS

choice_index = li.button_dialog('Please zoom on the figure and click Next.',
                                choices=['Next', 'Cancel'],
                                title='User interaction',
                                icon='gear')

button_dialog_user_interaction_macOS

This is a blocking function. We wait for a choice before continuing. Meanwhile, Matplotlib's event loop is refreshed so that the user can interact with figures.

Other functions

Get a file name using the operating system's standard file selection window:

filename = li.get_filename()

Get a folder name using the operating system's standard folder selection window:

folder = li.get_folder()

Credits

This module is developed by Félix Chénier at the Mobility and Adaptive Sports Research Lab (https://felixchenier.uqam.ca).

It includes artwork developed by these designers:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

limitedinteraction-0.2.2.tar.gz (353.4 kB view details)

Uploaded Source

Built Distribution

limitedinteraction-0.2.2-py3-none-any.whl (359.6 kB view details)

Uploaded Python 3

File details

Details for the file limitedinteraction-0.2.2.tar.gz.

File metadata

  • Download URL: limitedinteraction-0.2.2.tar.gz
  • Upload date:
  • Size: 353.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.6

File hashes

Hashes for limitedinteraction-0.2.2.tar.gz
Algorithm Hash digest
SHA256 12d4320eddb9bfcda258269107efe360f8603bdac0a95ad4596da50ab8e8f71e
MD5 4b29f291c79e28f97d2570bd5b4dbc65
BLAKE2b-256 04af311bce3ea49be51d4e459fc9da1cead59cd957bf31c46c74df01c641a55e

See more details on using hashes here.

File details

Details for the file limitedinteraction-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: limitedinteraction-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 359.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.6

File hashes

Hashes for limitedinteraction-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 87c3ce583c14f88376bee3f729318e969247f2347d92dd50a55a6fe306c5de10
MD5 cae98b40f7b916614d6ac05c5e9dc8e4
BLAKE2b-256 bd3b2a005fbbff84d702a45ac8318804c1bc602d7014b433a1be888c2c4f07be

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page