Installing Python 3 on Linux
python3
package is not recent enough for you, there may be ways of installing more recent versions as well, depending on you distribution. For example installing the python36
package on Fedora 25 to get Python 3.6. If you are a Fedora user, you might want to read about multiple Python versions available in Fedora.Working with Python 3
pip
command is meant for Python 2, while the pip3
command is meant for Python 3.How to Download and Install Python 3.6 on Windows 10
Cum se instalează Python pe Windows
NCURSES Programming HOWTO
A Word about Windows
printw("Hi There !!!"); refresh(); |
wprintw(win, "Hi There !!!"); wrefresh(win); |
printw(string); /* Print on stdscr at present cursor position */ mvprintw(y, x, string);/* Move to (y, x) then print string */ wprintw(win, string); /* Print on window win at present cursor position */ /* in the window */ mvwprintw(win, y, x, string); /* Move to (y, x) relative to window */ /* co-ordinates and then print */ |
Introduction
In the olden days of teletype terminals, terminals were away from computers and were connected to them through serial cables. The terminals could be configured by sending a series of bytes. All the capabilities (such as moving the cursor to a new location, erasing part of the screen, scrolling the screen, changing modes etc.) of terminals could be accessed through these series of bytes. These control seeuqnces are usually called escape sequences, because they start with an escape(0x1B) character. Even today, with proper emulation, we can send escape sequences to the emulator and achieve the same effect on a terminal window.
Suppose you wanted to print a line in color. Try typing this on your console.
echo "^[[0;31;40mIn Color"
The first character is an escape character, which looks like two characters ^ and [. To be able to print it, you have to press CTRL+V and then the ESC key. All the others are normal printable characters. You should be able to see the string "In Color" in red. It stays that way and to revert back to the original mode type this.
echo "^[[0;37;40m"
Now, what do these magic characters mean? Difficult to comprehend? They might even be different for different terminals. So the designers of UNIX invented a mechanism named termcap. It is a file that lists all the capabilities of a particular terminal, along with the escape sequences needed to achieve a particular effect. In the later years, this was replaced by terminfo. Without delving too much into details, this mechanism allows application programs to query the terminfo database and obtain the control characters to be sent to a terminal or terminal emulator.
Compiling With the NCURSES Library
#include <ncurses.h> . . . compile and link: gcc <program file> -lncurses |
#include <ncurses.h>
int main()
{
initscr(); /* Start curses mode */
printw("Hello World !!!"); /* Print Hello World */
refresh(); /* Print it on to the real screen */
getch(); /* Wait for user input */
endwin(); /* End curses mode */
return 0;
}
|
An Example
Let's write a program which will clarify the usage of these functions.
Example 2. Initialization Function Usage example
#include <ncurses.h>
int main()
{ int ch;
initscr(); /* Start curses mode */
raw(); /* Line buffering disabled */
keypad(stdscr, TRUE); /* We get F1, F2 etc.. */
noecho(); /* Don't echo() while we do getch */
printw("Type any character to see it in bold\n");
ch = getch(); /* If raw() hadn't been called
* we have to press enter before it
* gets to the program */
if(ch == KEY_F(1)) /* Without keypad enabled this will */
printw("F1 Key pressed");/* not get to us either */
/* Without noecho() some ugly escape
* charachters might have been printed
* on screen */
else
{ printw("The pressed key is ");
attron(A_BOLD);
printw("%c", ch);
attroff(A_BOLD);
}
refresh(); /* Print it on to the real screen */
getch(); /* Wait for user input */
endwin(); /* End curses mode */
return 0;
}
|
NCURSES Programming HOWTO
- 1.1. What is NCURSES?
- 1.2. What we can do with NCURSES
- 1.3. Where to get it
- 1.4. Purpose/Scope of the document
- 1.5. About the Programs
- 1.6. Other Formats of the document
- 1.7. Credits
- 1.8. Wish List
- 1.9. Copyright
- 2.1. Compiling With the NCURSES Library
- 2.2. Dissection
- 4.1. Initialization functions
- 4.2. raw() and cbreak()
- 4.3. echo() and noecho()
- 4.4. keypad()
- 4.5. halfdelay()
- 4.6. Miscellaneous Initialization functions
- 4.7. An Example
- 7.1. getch() class of functions
- 7.2. scanw() class of functions
- 7.3. getstr() class of functions
- 7.4. Some examples
- 8.1. The details
- 8.2. attron() vs attrset()
- 8.3. attr_get()
- 8.4. attr_ functions
- 8.5. wattr functions
- 8.6. chgat() functions
- 9.1. The basics
- 9.2. Let there be a Window !!!
- 9.3. Explanation
- 9.4. The other stuff in the example
- 9.5. Other Border functions
- 10.1. The basics
- 10.2. Changing Color Definitions
- 10.3. Color Content
- 11.1. The Basics
- 11.2. A Simple Key Usage example
- 12.1. The Basics
- 12.2. Getting the events
- 12.3. Putting it all Together
- 12.4. Miscellaneous Functions
- 13.1. getyx() functions
- 13.2. Screen Dumping
- 13.3. Window Dumping
- 14.1. curs_set()
- 14.2. Temporarily Leaving Curses mode
- 14.3. ACS_ variables
- 16.1. The Basics
- 16.2. Compiling With the Panels Library
- 16.3. Panel Window Browsing
- 16.4. Using User Pointers
- 16.5. Moving and Resizing Panels
- 16.6. Hiding and Showing Panels
- 16.7. panel_above() and panel_below() Functions
- 17.1. The Basics
- 17.2. Compiling With the Menu Library
- 17.3. Menu Driver: The work horse of the menu system
- 17.4. Menu Windows
- 17.5. Scrolling Menus
- 17.6. Multi Columnar Menus
- 17.7. Multi Valued Menus
- 17.8. Menu Options
- 17.9. The useful User Pointer
- 18.1. The Basics
- 18.2. Compiling With the Forms Library
- 18.3. Playing with Fields
- 18.4. Form Windows
- 18.5. Field Validation
- 18.6. Form Driver: The work horse of the forms system
- 20.1. The Game of Life
- 20.2. Magic Square
- 20.3. Towers of Hanoi
- 20.4. Queens Puzzle
- 20.5. Shuffle
- 20.6. Typing Tutor
python-parrot 1.0.0
$ pip install python-parrot
Usage
$ parrot port filename
- port: Port to listen on
- filename: Filename of the data to send in response to all requests
MathJax / mhchem Manual
Mhchem este un instrument de scriere a ecuațiilor chimice frumoase cu ușurință.Acesta este manualul pentru sintaxa de intrare a lui mhchem.
Acesta acoperă versiunea 3.2.x a lui MathJax / mhchem.
mhchem este o extensie terță parte pentru MathJax . Pentru informații despre cum să încărcați extensia și să faceți \cecomanda disponibilă, consultați documentele oficiale MathJax . Pe scurt, utilizați această config:
MathJax.Ajax.config.path["mhchem"] =
"https://cdnjs.cloudflare.com/ajax/libs/mathjax-mhchem/3.2.0";
MathJax.Hub.Config({
TeX: {
extensions: ["[mhchem]/mhchem.js"]
}
});
ecuațiile chimice (ce)C O 2+C⟶2C OCOX2+C⟶2CO
$\ce{CO2 + C -> 2 CO}$
H g 2 +-→I -H g I 2-→I -[ H g I - amI 4] 2 -HgX2+→euX-HgeuX2→euX-[HgXeueueuX4]X2-
$\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}$