A terminal emulator for Tkinter
Project description
TkTerminal
A terminal emulator written in Python using tkinter
Views:
Windows
MacOS
Example:
from tkinter import Tk
from tkterm import Terminal
# Create root window
root = Tk()
# Hide root window during initialization
root.withdraw()
# Set title
root.title("Terminal")
# Create terminal
term = Terminal(root)
term.pack(expand=True, fill="both")
# Set minimum size and center app
# Update widgets so minimum size is accurate
root.update_idletasks()
# Get minimum size
minimum_width: int = root.winfo_reqwidth()
minimum_height: int = root.winfo_reqheight()
# Get center of screen based on minimum size
x_coords = int(root.winfo_screenwidth() / 2 - minimum_width / 2)
y_coords = int(root.wm_maxsize()[1] / 2 - minimum_height / 2)
# Place app and make the minimum size the actual minimum size (non-infringable)
root.geometry(f"{minimum_width}x{minimum_height}+{x_coords}+{y_coords}")
root.wm_minsize(minimum_width, minimum_height)
# Show root window
root.deiconify()
# Start mainloop
root.mainloop()
Install:
pip install tktermwidget
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
tktermwidget-0.0.3.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for tktermwidget-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8294d1ea3acda21c0b9f86faf4509a95a1b1fc2c6e1297bfb643265c8d065a8 |
|
MD5 | 773d694c5e4c3d26f8894d99a17b3262 |
|
BLAKE2b-256 | 66ff7ae06dafd7bcd00a6ad972ad6b79d33fe22a4285793428bcf79edef30cdf |