-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfos.py
executable file
·26 lines (21 loc) · 1.01 KB
/
infos.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
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import unicodecsv as csv
from subprocess import call
def getAll(surname):
with open('wmiStaff.tsv') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
if surname in row['name'].lower():
print('\n' + row['faculty'] + '\n\t'+ row['lvl'] + ' ' + row['name'] + '\n\ttelefon: ' + row['phone'] + '\n\te-mail: ' + row['mail'] + '\n\tpokoj: ' + row['room'] + '\n\tkonsultacje: ' + row['when'])
def search(value = 'gralinski',key = 'name',filters = ['faculty','position','lvl','name','room','phone','mail','website','when']):
speak=''
with open('wmiStaff.tsv') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
if value in row[key].lower().replace("-",""):
for reply in filters:
print('\t' + reply + ': ' + row[reply])
speak=speak + ' ' + row[reply]
call("echo" + speak.lower() + " | espeak -v pl", shell=True)
#call("echo" + speak.lower() + " | festival --tts --language polish", shell=True)