![]() |
Display TTY
1
Customise your terminal's output
|
This project now has automated documentation that gets generated, this manually written one will remain for legacy reasons, but you can now take a look at the automatic documentation here: https://hanra-s-work.github.io/display_tty/
This is a python package I created in order to simplify the boiling process for displaying text in a geometrical shape drawn using characters.
The package was originally named disp
but had to be changed to display_tty
because the names disp
and display
were already taken by other packages.
The class will still remain Disp
but bindings named Display
, DispTTY
and DisplayTTY
are available.
The Preloaded version exists under: IDISP
, IDISPLAY
, IDTTY
and IDISPTTY
Under Windows:
Under Linux/Mac OS:
The generic class is: Disp(toml_content: dict, save_to_file: bool = False, file_name: str = "text_output_run.txt", file_descriptor: any = None)
For your convenience, you can use the IDTTY
variable which is an initialised version of the class.
Otherwise, if you wish to initialise the class with your own parameters, you can do so like this:
The generic function is:
The output is: None
The generic function to display Hello World!
as a title is (If we use the Pre-initialised class instance):
The generic function to display Hello World!
as a sub title is (If we use the Pre-initialised class instance):
The generic function to display Hello World!
as a sub sub title is (If we use the Pre-initialised class instance):
The generic function to display Hello World!
as a message is (If we use the Pre-initialised class instance):
The generic function to display Hello World!
as a message is (If we use the Pre-initialised class instance):
The generic function to display Hello World!
as a question message is (If we use the Pre-initialised class instance):
The generic function to display Hello World!
as an error message is (If we use the Pre-initialised class instance):
The generic function to display Hello World!
as a success message is (If we use the Pre-initialised class instance):
The generic function to display Hello World!
as a warning message is (If we use the Pre-initialised class instance):
The generic function to display Hello World!
as an inform message is (If we use the Pre-initialised class instance):
The generic function to display Hello World!
as a message in a box is (If we use the Pre-initialised class instance):
The generic function to display Hello World!
in a rounded message box is (If we use the Pre-initialised class instance):
The generic function to display Hello World!
in a vertical message box is (If we use the Pre-initialised class instance):
The generic function to display the current date as a title is (If we use the Pre-initialised class instance):
The generic function to display a message in a box made of different characters is (If we use the Pre-initialised class instance):
The generic function to display a message in a box without vertical bars is (If we use the Pre-initialised class instance):
The generic function to display a message in a box without horizontal bars is (If we use the Pre-initialised class instance):
When initialising the class it is possible to change the animation behaviour by editing the TOML_CONF
that you must provide when initialising the class.
During the initialisation it is also possible to redirect the output to a file instead of displaying it on the terminal. For this, please set the save_to_file
to True
and either:
file_name
file_descriptor
If you provided a file_name
, the file will automatically be opened However, in both cases, you will need to close the file by calling the function close_file
(i.e. at the end of your program)
This is the arguments that are required in the TOML
file:
PS: I've added line numbers <number> |
to help you track the analysis of the file, these are generally added automatically by your code editor.
Thats a big file, lets break it down together:
This option is a crucial pivot for the program.
If:
True
: The program will output the content letter by letter while waiting a specified delayFalse
: It will print out all of your messages at once without waiting any delayThis option is an optimisation for the program.
If:
True
: The program will:False
: It will print out all of your messages at once without waiting any delayThis is a customisation, it allows you to specify the characther to use when displaying a message.
This is a customisation, it allows you to specify the characther to use when displaying an error message.
This is a customisation, it allows you to specify the characther to use when displaying an inform message.
This is a customisation, it allows you to specify the characther to use when displaying a question message.
This is a customisation, it allows you to specify the characther to use when displaying a success message.
This is a customisation, it allows you to specify the characther to use when displaying a warning message.
This is a customisation, it allows you to specify the characther to use when displaying a sub sub title.
This is a customisation, it allows you to specify the characther to use when displaying a sub title.
This is a customisation, it allows you to specify the characther to use when displaying a title.
This is the character used by the tree function to indicate the indentation level
i.e:
This is the character used by the tree function to indicate the file/folder of the current line
i.e:
This is the character used by the tree function to indicate the directory level to wich the file/directory is linked but that this is not the last file/directory.
i.e:
This is the character used by the tree function to indicate the directory level to wich the file/directory is linked but that this is the last file/directory.
i.e:
Specify the delay between each word placement. (min: 0)
PS: if you enter 0, this is like setting PRETTY_OUTPUT_IN_BLOCS
to False
This variable is a pivot point for the program.
Specify the delay between each word placement. (min: 0)
PS: if you enter 0, this is like setting PRETTY_OUTPUT_IN_BLOCS
to False
If the default initialisation, or the class you previously initialised has some elements you would like to update, you can do so by calling the inner variables.
Here are the variables you might be interested in:
To update a variable, simply assing it a new value, like in this example: IDTTY.title_wall_chr = "&"
PS: These changes only apply to the class you loaded, any others will not be touched.
This module was written by (c) Henry Letellier Attributions are appreciated.
Quick way:
The current version is 1.0.0
An easy way to display the version is: