Python 3 Tkinter Command Line or Terminal Widget Using tkterminal Library GUI Desktop App Full Project For Beginners

 

 

pip install tkterminal

 

 

 

 

 

main.py

 

 

import tkinter as tk
from tkterminal import Terminal

root = tk.Tk()
terminal = Terminal(pady=5, padx=5)
terminal.pack(expand=True, fill='both')
root.mainloop()

 

 

Options Description
background The default background color of the terminal widget.
borderwidth The width of the border around the terminal widget. Default is 2 pixels.
cursor The cursor that will appear when the mouse is over the terminal widget.
exportselection Normally, text selected within a terminal widget is exported to be the selection in the window manager. Set exportselection=0 if you don’t want that behavior.
font The default font for text inserted into the widget.
foreground The color used for text within the widget. You can change the color for tagged regions; this option is just the default.
height The height of the widget in lines (not pixels!), measured according to the current font size.
highlightbackground The color of the focus highlight when the terminal widget does not have focus.
highlightcolor The color of the focus highlight when the terminal widget has the focus.
highlightthickness The thickness of the focus highlight. Default is 0.
insertbackground The color of the insertion cursor. Default is black.
insertborderwidth Size of the 3-D border around the insertion cursor. Default is 0.
insertofftime The number of milliseconds the insertion cursor is off during its blink cycle. Set this option to zero to suppress blinking. Default is 300.
insertontime The number of milliseconds the insertion cursor is on during its blink cycle. Default is 600.
insertwidth Width of the insertion cursor (its height is determined by the tallest item in its line). Default is 2 pixels.
padx The size of the internal padding added to the left and right of the text area. Default is one pixel.
pady The size of the internal padding added above and below the text area. Default is one pixel.
relief The 3-D appearance of the terminal widget. Default is relief=SUNKEN.
selectbackground The background color to use displaying selected text.
selectborderwidth The width of the border to use around selected text.
spacing1 This option specifies how much extra vertical space to add between displayed lines of text when a logical line wraps. Default is 0.
spacing2 This option specifies how much extra vertical space to add between displayed lines of text when a logical line wraps. Default is 0.
spacing3 This option specifies how much extra vertical space is added below each line of text. If a line wraps, this space is added only after the last line it occupies on the display. Default is 0.
state Normally, terminal widgets respond to keyboard and mouse events; set state=NORMAL to get this behavior. If you set state=DISABLED, the terminal widget will not respond, and you won’t be able to pass commands into the terminal.
tabs This option controls how tab characters position text.
width The width of the widget in characters (not pixels!), measured according to the current font size.
wrap This option controls the display of lines that are too wide. Set wrap=WORD and it will break the line after the last word that will fit. With the default behavior, wrap=CHAR, any line that gets too long will be broken at any character.
xscrollcommand To make the terminal widget horizontally scrollable, set this option to the set() method of the horizontal scrollbar.
yscrollcommand To make the terminal widget vertically scrollable, set this option to the set() method of the vertical scrollbar.

Leave a Reply