-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrandomSelect.py
More file actions
47 lines (38 loc) · 1.27 KB
/
randomSelect.py
File metadata and controls
47 lines (38 loc) · 1.27 KB
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
from __future__ import division
import random
from pyfiglet import Figlet
from asciimatics.effects import Cog, Print, Cycle
from asciimatics.renderers import FigletText
from asciimatics.scene import Scene
from asciimatics.screen import Screen
from asciimatics.exceptions import ResizeScreenError
import sys
autoTeam = [
'Pawel',
'Dawid',
'Monika',
'Darek',
'Michal',
'Marcin',
]
secure_random = random.SystemRandom()
def demo(screen):
# Typical terminals are 80x24 on UNIX and 80x25 on Windows
f = Figlet(font='slant')
effects = [
Cog(screen, 20, 10, 10),
Cog(screen, 60, 25, 15, direction=-1),
Print(screen, FigletText(f.renderText(secure_random.choice(autoTeam)), font="term"), x=45, y=22, start_frame=60)
]
effects.append( Print(screen, FigletText(f.renderText('Super team na dzis:'), font='term'), x=90, y=int(0)))
currentMemberIndex = 1
for member in autoTeam:
effects.append( Print(screen, FigletText(f.renderText(member), font='term'), x=120, y=int(7 * currentMemberIndex)+2))
currentMemberIndex += 1
screen.play([Scene(effects, -1)], stop_on_resize=True)
while True:
try:
Screen.wrapper(demo)
sys.exit(0)
except ResizeScreenError:
pass