<div><h2id="tuple"><ahref="#tuple"name="tuple">#</a>Tuple</h2><p><strong>Tuple is an immutable and hashable list.</strong></p><pre><codeclass="python language-python hljs"><tuple> = ()
<div><h2id="tuple"><ahref="#tuple"name="tuple">#</a>Tuple</h2><p><strong>Tuple is an immutable and hashable list.</strong></p><pre><codeclass="python language-python hljs"><tuple> = ()
<div><h2id="curses"><ahref="#curses"name="curses">#</a>Curses</h2><div><h4id="clearstheterminalprintsamessageandwaitsfortheesckeypress">Clears the terminal, prints a message and waits for the ESC key press:</h4><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">from</span> curses <spanclass="hljs-keyword">import</span> wrapper, curs_set, ascii
<div><h2id="curses"><ahref="#curses"name="curses">#</a>Curses</h2><div><h4id="runsabasicfileexplorerintheterminal">Runs a basic file explorer in the terminal:</h4><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">from</span> curses <spanclass="hljs-keyword">import</span> wrapper, ascii, A_REVERSE, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, KEY_ENTER
curs_set(<spanclass="hljs-number">0</span>) <spanclass="hljs-comment"># Makes cursor invisible.</span>
screen.clear()
screen.nodelay(<spanclass="hljs-keyword">True</span>) <spanclass="hljs-comment"># Makes getch() non-blocking.</span>
<spanclass="hljs-keyword">for</span> y, path_<spanclass="hljs-keyword">in</span> enumerate(paths[first : first+height]):
screen.clear()
screen.addstr(y, <spanclass="hljs-number">0</span>, path_, A_REVERSE * (selected == first + y))
screen.addstr(<spanclass="hljs-number">0</span>, <spanclass="hljs-number">0</span>, <spanclass="hljs-string">'Press ESC to quit.'</span>) <spanclass="hljs-comment"># Coordinates are y, x.</span>
xxxxxxxxxx