The Curses Library (ncurses) provides a terminal-independent method for controlling character screens. Curses is a standard part of most UNIX-like systems, including Linux, and it has been ported to Windows and other systems. The curses program runs
The Curses Library (ncurses) provides a terminal-independent approach to controlling character screens. Curses is a standard part of most UNIX-like systems, including Linux, and it has been ported to Windows and other systems. The curses program
Python curses, pythoncurses
In python, curses encapsulates the c-language curses and simplifies the complex section of c, such as addstr (), mvaddstr (), and mvwaddstr (), and merges them into an addstr () method.1. Syntax 1. Open and Close a curses
This article mainly introduces the simple Python curses library usage tutorial. it is from the IBM official Developer Technical Documentation. if you need it, you can refer to the curses library (ncurses) it provides a terminal-independent method
With the popularization of computer knowledge, more and more computer enthusiasts begin to understand and use Linux. The ease and freedom of Linux gives us different feelings. However, we cannot meet the requirements of basic commands.
With the
Python curses encapsulates the C language curses, simplifying the complex parts of C, such as ADDSTR (), Mvaddstr (), and Mvwaddstr () into a addstr () method.I. Getting Started with grammar 1. Open and close a curses applicationInitialize the
Linux curses function library and curses function library
Fedora20, install yum install ncurses-devel
Compile time:-lncurses
Header file: # include
Reference: man ncurses \ linux Program Design
I. Screen
1. Start with initscr () and end with
Cui character InterfaceGui: graphical interface
Use a set of encapsulated library libcruses. SoOld Version libcurses. SoNew Version libncruses. So-Lcurses or-lncurses are required during compilation.If the header file curses. h does not exist, use
2.7 color attributes
==================
2.7.1 Color Description
---------------
* The curses library uses the RGB method to represent a color.
* The default colors are:
Color index number
--------------- + --------
COLOR_BLACK 0
COLOR_RED
A class of Python applications is best to use an interactive user interface, which eliminates the overhead or complexity of the graphics environment. Interactive text-mode programs (in Linux/unix), such as ncurses libraries encapsulated in the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.