-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
39 lines (32 loc) · 1.07 KB
/
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
import sys
from gedcomFileParser import GEDCOMFileParser
from userStory import checkUserStory , display
from prettytable import PrettyTable
fileName = 'falsetree.ged'
x = PrettyTable()
y = PrettyTable()
def main():
individual, families = GEDCOMFileParser(fileName)
checkUserStory(individual, families)
displayData(individual, families)
print()
display()
def displayData(individual, families):
# displaying data for individuals
x.field_names = ["id","Name","Gender","Birthday","Age","Alive","Death","Child","Spouse"]
for line in individual:
attrs = vars(line)
x.add_row(attrs.values())
print("Individuals: ")
print(x)
# displaying data for families
y.field_names = ["id","Married","Divorced","Husband ID","Husband Name","Wife ID","Wife Name","Children"]
for line in families:
attrs = vars(line)
y.add_row(attrs.values())
print("Families: ")
print(y)
if __name__ == '__main__':
sys.stdout = open("output.txt","w")
main()
sys.__stdout__.close()