2024-06-19 22:33:28 +07:00

1.3 KiB

Dialog

import PyserSSH.extensions.dialog as dialog

Dialog extension is a nifty little tool. This extension actually recreates standard Windows dialog boxes in a text environment using ANSI escape control codes. It is installed in library by default.

Text Dialog

This dialog show only text

DL = dialog.TextDialog(client, "Hello World")
DL.render()

Text Dialog

Menu Dialog

This dialog use for choose list

Mylist = ["Item 1", "Item 2", "Item 3", "Item 4", "Item 5"]

DL = dialog.MenuDialog(client, Mylist)
DL.render()
print(DL.output()) # output when user is selected

Menu Dialog

Input Dialog

This dialog use for input string or password !!! Bug "Bug" Maybe you can't backspace to clear all inputted when you type too fast

DL = dialog.TextInputDialog(client)
DL.render()
print(DL.output()) # output when user is typed and entered

Text Input Dialog

password input

DL = dialog.TextInputDialog(client, password=True)
DL.render()
print(DL.output()) # output when user is typed and entered password

Text Input Dialog with password input