You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

3.4 KiB

Python Refactoring

UTF-8

Unicode chartable

https://www.utf8-chartable.de/unicode-utf8-table.pl

Fullsize/Halfsize forms

https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms
https://en.wikipedia.org/wiki/Halfwidth_and_Fullwidth_Forms_(Unicode_block)

Ascii Fonts

https://github.com/phpjsnerd/ascii-fonts
https://github.com/phpjsnerd/ascii-fonts/blob/master/Calvin%20S.flf
https://www.texttool.com/ascii-font#p=display&f=Calvin%20S&t=Type%20Something%20%2012345
http://www.roysac.com/thedrawfonts-tdf.html#16

Terminal

ANSI Escape Sequences

https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797#file-ansi-md https://conemu.github.io/en/AnsiEscapeCodes.html

https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda

printf '\e]8;;http://example.com\e\\This is a link\e]8;;\e\\\n'

ANSI 16 256 24bit color conversion

https://www.calmar.ws/vim/256-xterm-24bit-rgb-color-chart.html

ANSI Colors

https://talyian.github.io/ansicolors/ http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html

Blinking Text

echo  -e "\033[5mBlinking Text\033[0m"
echo  -e "\033[33;5mBlinking Text\033[0m"
echo  -e "\033[33;7mBlinking Text\033[0m"
echo  -e "\033[33;5;7mBlinking Text\033[0m"

Sphinx Doc

Domains - docstring syntax

https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#directive-py-class

ReStructuredText

https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#explicit-markup-blocks

Disable SIGSTOP triggered by CTRL+S

# Disable
stty stop ''
# ReEnable = map stop top CTRL+S
stty stop '^s'
import sys, termios

attr = termios.tcgetattr(sys.stdin)
# Save the value to be restored
bak = attr[6][termios.VSTOP]

# Disable SIGSTOP triggered by CTRL+S
attr[6][termios.VSTOP]=0
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, attr)

'''. . . do stuff . . .'''

# reEnable SIGSTOP triggered by CTRL+S
attr[6][termios.VSTOP]=bak
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, attr)

Terminal Mapping:

  • CTRL-C -> termios.VINTR
  • CTRL-S -> termios.VSTOP
  • CTRL-Z -> termios.VSUSP
  • CTRL-Q -> termios.VSTART

Have a look at test.termios.001.py

GNU Nano Terminal Initialization

https://git.savannah.gnu.org/cgit/nano.git/tree/src/nano.c#n1199

Terminal Multiplexer

Get Default shell

import pwd, os
pwd.getpwuid(os.getuid()).pw_shell # values from /etc/passwd = '/bin/bash'

Check as reference:

Pty Demo:

Screenshot editor (FREEEEEEEE)

https://screenshotr.app/

  • presets: Canvas W = 1000 Browser Width = 950 Browser Scale = 1