Skip to main content

A terminal emulator for Tkinter

Project description

TkTerminal

PyPI Platform

🌏 简体中文

TkTerminal is a terminal emulator written in Python using tkinter. It is quite easy to use.

Windows

MacOS

Features

  • User can set the terminal widget with their own options
  • Use \ to make new lines (On Windows it is &&)
  • Command history recorder
  • Styles
  • And some on

Future ideas

  • Highlight

Styles

tkterminalwidget also have some styles to use such as Powershell Command: image

Installation:

pip install tktermwidget

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()

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.4.tar.gz (6.2 kB view hashes)

Uploaded Source

Built Distribution

tktermwidget-0.0.4-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

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