-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunme.py
65 lines (45 loc) · 844 Bytes
/
runme.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
from editme import *
from unicodes import *
import sys
from time import sleep
from os.path import getmtime
SOURCE_FILE = "editme.py"
t = 0
MOD_TIME = 0
# mode
m = 0
# background
b = "0"
# foreground
f = "0"
# character
c = "0"
# width (columns)
w = 64
# lines
l = 16
# sleep
s = 0
sys.stdout.write("\033[2J")
while True:
if t%w == 0:
sys.stdout.write("\n")
sleep(s)
if ((t%(w*l) == 0) & (m ==0 )) :
sys.stdout.write ("\033[0;0f")
if MOD_TIME != getmtime(SOURCE_FILE):
exec(open(SOURCE_FILE).read())
MOD_TIME = getmtime(SOURCE_FILE)
try:
BG_EXPR = eval(b)%256
BG_OUT = "\033[48;5;%dm" % BG_EXPR
sys.stdout.write(BG_OUT)
FG_EXPR = eval(f)%256
FG_OUT = "\033[38;5;%dm" % FG_EXPR
sys.stdout.write(FG_OUT)
CH_EXPR = eval(c)%224
CH_OUT = uni[CH_EXPR]
sys.stdout.write(CH_OUT)
except:
pass
t+=1