A small module for drawing console screens.
Project description
INFO:
MyScreen is a lightweight Python module that lets you create and manage simple text-based "screens" in the console.
You can write text to specific rows, align text, resize the screen, and clear it at any time.
INSTALLATION:
pip install myscreen
IMPORT MODULE CODE:
from myscreen import Screen
DOCUMENTATION:
You can startup a new screen with: example_display = Screen(rows, columns=, fill_char, align))
What each parameter does:
Rows and columns are self explanatory and default to (rows=7, columns=30) if nothing no argument is provided (int)
Fill_char is the text character used to fill any part of the screen that has no text, defaults to the = sign (string)
Align can be set to 'l', 'm', or 'r' and aligns the text on every line to the side specified, defaults middle (string)
EX: example_display = Screen(rows=7, columns=30, fill_char="=", align="m"))
You can edit any specified row/line with: example_display.write_line(text, row)
What each parameter does:
Text is the string that will be displayed on the line (string)
Row is where you specify which line to edit (int)
EX: example_display.write_line('abcdefg', 3)
You can clear/erase all lines with: example_display.clear_all()
No parameters are needed
EX: example_display.clear_all()
You can resize the screen with: example_display.resize(rows, columns)
Old lines are preserved as much as possible.
What each parameter does:
Rows and columns are self explanatory (int)
EX: example_display.resize(5, 25)
Finally, you can change the alignment of the screen with: example_display.set_alignment(align)
What each parameter does:
Align can be set to 'l', 'm', or 'r' and aligns the text on every line to the side specified (string)
EX: example_display.set_alignment('l')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
myscreen-0.1.0.tar.gz
(2.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file myscreen-0.1.0.tar.gz.
File metadata
- Download URL: myscreen-0.1.0.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e073344f29fca520602ac1fe2aa5d447adb340a94aedc3499b7609fe3f6dda35
|
|
| MD5 |
c54b9b75a7e5362f4c837ded4e5384c3
|
|
| BLAKE2b-256 |
b81ee4dea61dfd51f28a9233dd4ece76532ae9a43dd5b7b1fed52403572db74e
|
File details
Details for the file myscreen-0.1.0-py3-none-any.whl.
File metadata
- Download URL: myscreen-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
197b9ac1221eb0ec70713d1007848bad57f079930d0d8384dc8aebc664d16945
|
|
| MD5 |
d7af1cab155de873a0e21788854569c2
|
|
| BLAKE2b-256 |
99115b6342c78ba72d8af490915d9c902867a57c4d13c628ccfb9770a7d58d45
|