more functions and documentation
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
/home/filip/Documents/python3/ansi_escape/ansi_escape.py
|
||||
7
examples/backspace.py
Normal file
7
examples/backspace.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import ansi_escape, sys, time
|
||||
print("Hello World!!", end='')
|
||||
time.sleep(1)
|
||||
a = 0
|
||||
while a < 5:
|
||||
a += 1
|
||||
sys.stdout.write(ansi_escape.backspace)
|
||||
5
examples/bell.py
Normal file
5
examples/bell.py
Normal file
@@ -0,0 +1,5 @@
|
||||
import ansi_escape
|
||||
print(ansi_escape.bell_f(10000))
|
||||
a = 10
|
||||
while a < 10:
|
||||
print(ansi_escape.bell)
|
||||
@@ -1,8 +0,0 @@
|
||||
import ansi_escape
|
||||
a = 0
|
||||
while a < 10:
|
||||
a += 1
|
||||
print("Hello World!!")
|
||||
|
||||
a = input()
|
||||
print(ansi_escape.move_cursor("up", str(a)) + ansi_escape.el("both"))
|
||||
2
examples/dsr.py
Normal file
2
examples/dsr.py
Normal file
@@ -0,0 +1,2 @@
|
||||
import ansi_escape, sys
|
||||
print(ansi_escape.cup(column=23, row=22) + ansi_escape.dsr)
|
||||
@@ -1,2 +0,0 @@
|
||||
import ansi_escape, os
|
||||
print(ansi_escape.erase_from_cursor("2"))
|
||||
7
examples/garble_display.py
Normal file
7
examples/garble_display.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import ansi_escape
|
||||
from random import randint as randint
|
||||
while 1:
|
||||
print(ansi_escape.cup(column=randint(1, 80), row=randint(1, 30)) +
|
||||
ansi_escape.color("bg", randint(0, 255), randint(0, 255), randint(0, 255)) +
|
||||
" " +
|
||||
ansi_escape.unset("all"))
|
||||
3
examples/keyboard.py
Normal file
3
examples/keyboard.py
Normal file
@@ -0,0 +1,3 @@
|
||||
import ansi_escape
|
||||
print(ansi_escape.set_leds("reset"))
|
||||
input()
|
||||
@@ -1,7 +0,0 @@
|
||||
import keyboard, ansi_escape
|
||||
print(ansi_escape.erase_from_cursor("both"))
|
||||
keyboard.add_hotkey('up', ansi_escape.cursor, args=('up'))
|
||||
keyboard.add_hotkey('down', ansi_escape.cursor, args=('down'))
|
||||
keyboard.add_hotkey('left', ansi_escape.cursor, args=('backward'))
|
||||
keyboard.add_hotkey('right', ansi_escape.cursor, args=('forward'))
|
||||
keyboard.wait()
|
||||
@@ -2,8 +2,6 @@ import ansi_escape
|
||||
color = 0
|
||||
print(ansi_escape.escape + "]0;256 Color Terminal Palette" + ansi_escape.bell)
|
||||
while color <= 255:
|
||||
color = str(color)
|
||||
print(ansi_escape.color("256", "bg", color) + " " + " " * ( len(color) - 2 ) + color + " ", end="")
|
||||
color = int(color)
|
||||
print(ansi_escape.color("bg", color) + " " + " " * ( len(str(color)) - 2 ) + str(color) + " ", end="")
|
||||
color += 1
|
||||
input()
|
||||
@@ -1,4 +0,0 @@
|
||||
import ansi_escape, random
|
||||
while 1:
|
||||
print(ansi_escape.set_cursor(row=str(random.randint(1,20)), column=str(random.randint(1,20))) + ansi_escape.color("normal", "bg", "red") + " " + ansi_escape.reset)
|
||||
input()
|
||||
10
examples/simple_colors.py
Normal file
10
examples/simple_colors.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import ansi_escape
|
||||
print(ansi_escape.set("underline"))
|
||||
print(ansi_escape.color("ul", "bright-black") + "aa")
|
||||
print(ansi_escape.color("bg", "bright-red") + " ")
|
||||
print(ansi_escape.color("bg", "bright-green") + " ")
|
||||
print(ansi_escape.color("bg", "bright-yellow") + " ")
|
||||
print(ansi_escape.color("bg", "bright-blue") + " ")
|
||||
print(ansi_escape.color("bg", "bright-magenta") + " ")
|
||||
print(ansi_escape.color("bg", "bright-cyan") + " ")
|
||||
print(ansi_escape.color("bg", "bright-white") + " ")
|
||||
2
examples/size.py
Normal file
2
examples/size.py
Normal file
@@ -0,0 +1,2 @@
|
||||
import ansi_escape
|
||||
print(ansi_escape.esc + "[18t")
|
||||
@@ -1,13 +0,0 @@
|
||||
import ansi_escape
|
||||
a = 0
|
||||
while a < 256:
|
||||
b = str(a)
|
||||
print(ansi_escape.color("256", "bg", b) + " " + b + " " + ansi_escape.reset, end='')
|
||||
a += 1
|
||||
|
||||
print(ansi_escape.escape + "]0;Demo" + ansi_escape.escape + "\\")
|
||||
input()
|
||||
print("hello" + ansi_escape.move_cursor("up", "2"))
|
||||
input()
|
||||
print(ansi_escape.erase_from_cursor("forward"))
|
||||
input()
|
||||
3
examples/title.py
Normal file
3
examples/title.py
Normal file
@@ -0,0 +1,3 @@
|
||||
import ansi_escape
|
||||
print(ansi_escape.set_title("hello"))
|
||||
input()
|
||||
Reference in New Issue
Block a user