cli-dev is a project aimed at exploring and replicating existing command-line interface (CLI) tools and games using Python.
- more.py: A Python script replicating the functionality of the
more
command line utility in Linux. It reads from a file in batches, displaying content as needed. The script uses thecurses
library to manage terminal input and output.
- Reads file content in batches, displaying as much as the screen can fit.
- Uses
curses
for terminal handling. - Displays progress percentage while reading the file.
- Provides an option to quit the application by pressing 'q'.
To run the script, ensure you have Python installed on your system. Additionally, you'll need the curses
library, which is included with Python on Unix-based systems. For Windows, you can install windows-curses
via pip:
pip install windows-curses
To use more.py
, simply run the script with the file you wish to read as an argument:
python more.py --fname yourfile.txt
- Currently throws an error if the screen size is too small to fit the initial content.