-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOWL_SAY.py
More file actions
55 lines (39 loc) · 1.34 KB
/
OWL_SAY.py
File metadata and controls
55 lines (39 loc) · 1.34 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
48
49
50
51
52
53
54
55
#OWL SAY PYTHON SCRIPT:
import sys
def owl_say(str_value):
file_name=open("owl_say.log",'a')
sys.stdout = file_name
_blank=" "*50
print("{} {}".format(_blank,_strvalue))
print("{} /".format(_blank))
print("{} / ".format(_blank))
print("{} ^ ^ ".format(_blank))
print(" ".format(_blank))
print("{} ( @ @ ) ".format(_blank))
print("{} __ ".format(_blank))
print("{}/ \\".format(_blank))
print("{}/ \\".format(_blank))
print("{}/ \\".format(_blank))
print("{}\ __ / ".format(_blank))
print("{} \/ \/ ".format(_blank))
print('_'*170)
sys.stdout = sys.__stdout__
rep=int(input("Enter number of inputs:\n"))
for i in range(0,rep):
_strvalue=str(input("Enter word to say:"))
len_val=len(_strvalue)
print('_'*170)
if len_val== 0:
print ("Stoppping script")
exit(0)
elif len(_strvalue) >175:
print ("\"Owl can not say anything\"")
_strvalue="..........."
owl_say(_strvalue)
exit(1)
else:
owl_say(_strvalue)
print("Output are logged to file owl_say.log")
value_print=open("owl_say.log",'r')
print (value_print.read())
value_print.close()