Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Breif

Give your python script a front end with a few lines of code.

import curses
from looks import app

# example text file
with open('random_text_file.txt', 'r') as f:
    buffer_test = f.read()
    f.close()

lines = buffer_test.splitlines()
import time
def appService(app_front):
    # type: (app) -> None
    while True:
        if app_front.key_inputs:
            key = app_front.key_inputs.pop(0)
            if key == curses.KEY_CLOSE:
                break
        if lines:
            app_front.content += [lines.pop(0)]
            app_front.scrolldown()
            time.sleep(0.5)

# scroll down button handler
def S_button_click():
    myApp.scrolldown()
    pass

myApp = app(
    'text reader', 
    appService, 
    buttons=[('S', S_button_click)], 
    content=buffer_test.splitlines()
) 

myApp.activate()

alt text

License

This project is licensed under the GNU General Public License v3.0.

About

A lightweight Python module for building interactive text-based GUIs using curses with a simple, declarative API.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages