repl.it
@4pip/

Gekleurde teksten

Python

Gekleurde teksten

fork
loading
Files
  • main.py
main.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
import sys,time,random
print ()
print ('Snelheid van typen)')
print ()
print ('hello world (normal)')
def sprint(str):
   for c in str + '\n':
     sys.stdout.write(c)
     sys.stdout.flush()
     time.sleep(3./90)
sprint('hello world (sprint)')
def half(str):
   for c in str + '\n':
     sys.stdout.write(c)
     sys.stdout.flush()
     time.sleep(3./50)
half('hello world (half)')
def slow(str):
   for c in str + '\n':
     sys.stdout.write(c)
     sys.stdout.flush()
     time.sleep(3./20)
slow('hello world (slow)')
time.sleep(2)
print ()
print ()
print ('Tekst kleuren in Python')
print ()
print('\033[1;30;40m Zwart')
print('\033[1;31;40m Rood')
print('\033[1;32;40m Groen')
print('\033[1;33;40m Oranje')
print('\033[1;34;40m Blauw')
print('\033[1;35;40m Paars')
print('\033[1;36;40m Lichtblauw')
print('\033[1;37;40m Wit')
time.sleep(2)
print ()
print ()
print('Achtergrond')
print ()
print('\033[1;32;40m Zwart')
print('\033[1;32;41m Rood')
print('\033[1;32;42m Groen')
print('\033[1;32;43m Oranje')
print('\033[1;32;44m Blauw')
print('\033[1;32;45m Paars')
time.sleep(2)
print ()
print ()
print ('\033[1;37;40m Lettertypes')
print ()
print('\033[0;37;40m Geen Effect')
print('\033[1;37;40m Vet')
print('\033[2;37;40m Streep')
print('\033[3;37;40m Negatief 1')
print('\033[5;37;40m Negatief 2')
time.sleep(2)
print ()
print ()