An extension program to curses that offers option menus, message boxes, file dialogues and more
Project description
Curses Plus
Extension library to curses
How To Install
Use pip3 install cursesplus
on Linux or py -m pip install cursesplus
on Windows
SPECIAL INSTRUCTIONS FOR WINDOWS
For Windows you need to also install windows-curses or related program
to provide the basic curses functionality
What's New?
3.20
-
A big round number means a big update
-
Add searchable_option_menu, which allows you to filter large amounts of options live using regex.
3.19
-
Rewrite date and time selector
-
Same arguments, but it has an all-new and very nice UI
3.18:
-
Add bargraph to show a bargraph
-
Add savefile_selector() to be able to prompt the user to save a file.
-
textview can now save to a file
-
Add the ability to show/hide the cursor when activated
NOTICE! 3.x - Breaking Changes
The following changes likely require changes in your code
-
Move filline, showcursor, and hidecursor to a new module called utils.
-
Fix spelling issue, utils.filline is now utils.fill_line
-
Change displayops to optionmenu. Please refactor all calls from displayops() to optionmenu(): No other changes are required
-
Remove legacy function
showerror. Use messagebox.showerror as a replacement -
Remove legacy function
askyesno_old. Use messagebox.askyesno as a replacement -
Combine
displaymsganddisplaymsgnodelayinto one function -
Existing
displaymsgnodelaycalls can be changed todisplaymsg(stdscr,[messages],False), so change the flag wait_for_keypress to false -
Remove redundant american function
set_color. You can either use the (correct) spellingset_colouror you can not use this library.
Documentation
transitions.py
transitions contains many transitions to add animations to your program
__exec(func,args)
NOTE: THIS IS AN INTERNAL FUNCTION, IT IS NOT MEANT TO BE USED BY THE COMMON USER
This executes func(args)
horizontal_bars(stdscr,func_to_call=None,args=(),speed=1)
This is a replacement function to old's type zero. It fills the screen from the top down with horizontal white bars. It then replaces them with black bars in the same configuration.
-
stdscris a curses window object -
func_to_callis a function. If it is set to none, no function is called -
argsis a tuple. The tuple will be passed to the function as arguments -
speedis an int. A higher value increases the animation speed. A lower value (0 - 1) makes it slower. If you set speed to 0, the program will crash.
random_blocks(stdscr,func_to_call=None,args=(),speed=1)
This is a replacement for old's type one transition. It fills random characters of the screen with blocks until the whole screen is covered, then it removes it in the same fashion.
-
stdscris a curses window object -
func_to_callis a function. If it is set to none, no function is called -
argsis a tuple. The tuple will be passed to the function as arguments -
speedis an int. A higher value increases the animation speed. A lower value (0 - 1) makes it slower. If you set speed to 0, the program will crash.
vertical_bars(stdscr,func_to_call=None,args=(),speed=1)
This is an all new transition. It functions like horizontal bars except they are vertical and go left to right.
-
stdscris a curses window object -
func_to_callis a function. If it is set to none, no function is called -
argsis a tuple. The tuple will be passed to the function as arguments -
speedis an int. A higher value increases the animation speed. A lower value (0 - 1) makes it slower. If you set speed to 0, the program will crash.
utils.py
Utils.py Contain a series of non-ui utility functions. By non-ui I mean that it does not show a screen and it is non-interactive. It is meant to enhance the creation of custom menus.
fill_line(stdscr,line,colour)
This function fills row line with the colour colour.
-
stdscris a curses window object -
lineis an int. It is the row number you wish to fill in -
colouris a curses colour. Usecursesplus.set_colour()for this
hidecursor()
This function hides the console cursor
showcursor()
This function shows the console cursor
constants.py
constants.py contains a series of constants such as colours and special lines.
** This documentation is not yet complete. There are many more features than this **
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
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 cursesplus-3.20.1.tar.gz.
File metadata
- Download URL: cursesplus-3.20.1.tar.gz
- Upload date:
- Size: 23.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b5baa4a296e95ffe6daea9e12f8b0aac6672d5352e51ed396edb6b21d3d7dae
|
|
| MD5 |
ed57571bb0a989e4f709f622a00eec8f
|
|
| BLAKE2b-256 |
78436e7fb8e9dc8bff57bcc15dd245a156a23da439a9328e5928718e275972a5
|
File details
Details for the file cursesplus-3.20.1-py3-none-any.whl.
File metadata
- Download URL: cursesplus-3.20.1-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
740ce0ddd7fe1a073908618b7b510f385ddd83bf9f5cb367c01ad5983f17eaf9
|
|
| MD5 |
17057165425f0e9d4b23e526cf7005ae
|
|
| BLAKE2b-256 |
654ccf439268068ef3b0b79aa3ec1519bdc3ec15bafe277559c29919accdd2b8
|