relationship = common_ancestors(ID,ID2,newLine)[2]
if relationship[-11:] != 'not related':
- script = "ancestors.py?ID="+str(ID)+"&ID2="+str(ID2)
+ script = "ancestors.py?ID=%s&ID2=%s" % (ID,ID2)
url = link_Template.substitute\
(script = script,title = "Common ancestors"\
,text = "Common ancestors")
t = (terr,start)
myTitle = ''
for row in run_query(s,t):
- myTitle = myTitle +"previous - " + row[0] \
- + ',' + str(row[1])
+ myTitle += "previous - %s,%s" \
+ % (row[0],row[1])
break
u = "SELECT name,people.id"\
v = (terr,stop)
for r in run_query(u,v):
- myTitle = myTitle + '
' +"next - " + r[0] \
- + ',' + str(r[1])
+ myTitle += '
 next - %s,%s'\
+ %(r[0],r[1])
break
myTitle = add_quotes(myTitle)
return row[0]
else:
if html==1:
- script = "person.py?ID=" + str(row[1])
+ script = "person.py?ID=%s" %(row[1])
name = row[0]
return link_Template.substitute(script = script\
,title = add_quotes(name),text = name)
else:
- return row[0] + "," +str(row[1])
+ return "%s,%s" % (row[0],row[1])
def print_people(n):
if n>1:
- return ' people '
+ return 'people'
else:
- return ' person '
+ return 'person'
+def print_children(n):
+ if n>1:
+ return 'children'
+ else:
+ return 'child'
def print_age_child_count(row,newLine):
if newLine == '<br>':
- script = "listAge.py?age="+str(row[0])
+ script = "listAge.py?age=%s" % (row[0])
link = link_Template.substitute(script = \
script, title = add_quotes(row[0]), text = row[0])
- out = str(row[1])+print_people(row[1])
- out = out + 'had children at age '+ link + newLine
+ out = '%s %s had children at age %s %s'\
+ % (row[1],print_people(row[1]),link,newLine)
return out
else:
return print_row(row,newLine)
def print_age_death_count(row,newLine):
if newLine =='<br>':
- script = "listAgeDeath.py?age="+str(row[0])
+ script = "listAgeDeath.py?age=%s" % (row[0])
link = link_Template.substitute(script = script,\
title = add_quotes(row[0]),text = row[0])
- out = str(row[1])+print_people(row[1])
- out = out + "died at age " + link + newLine
+ out = "%s %s died at age %s %s " \
+ %(row[1],print_people(row[1]), link,newLine)
return out
else:
return print_row(row,newLine)
def print_name_count(row,newLine):
if newLine=='<br>':
- script = "name.py?name=" + row[0]
+ script = "name.py?name=%s" % (row[0])
link = link_Template.substitute(script =\
script, title = add_quotes(row[0]),text = row[0])
- return str(row[1]) + " people called "+link + newLine
+ return "%s people called %s%s"\
+ %(row[1],link, newLine)
else:
return print_row(row,newLine)
def print_children_count(row,newLine):
- out = str(row[0])
-
- if row[0]==1:
- out = out + ' person '
- else:
- out = out + ' people '
- out = out +'had '
+ out = "%s %s had " % (row[0],print_people(row[0]))
if newLine == '<br>':
script = "listChildCount.py?nc="+str(row[1])
else:
link = str(row[1])
- out = out + link
-
- if row[1] == 1:
- out = out + ' child '
- else:
- out = out + ' children '
-
-
- out = out + newLine
+ out += "%s %s %s" % (link,print_children(row[1]),newLine)
return out
def print_tagged_name(relationship,row,newLine):
if row[0]==None:
out = relationship + " not yet entered: " + row[1]
+ out = "%s not yet entered: %s" % (relationship,row[1])
else:
if newLine == '<br>':
html = 1
else:
html=0
if relationship =='':
- out = name_html(row,html) + ' '
+ out = '%s ' % (name_html(row,html))
else:
out = relationship + ": " + name_html(row,html)
+ out = '%s: %s' % (relationship,name_html(row,html))
return out + newLine
def month_numbers(monthN):
def ordinal_numbers(number):
number = int(number)
+ out = '%d' % (number)
if number % 10==1 and number/10 % 10 !=1:
- out = str(number) +'st'
+ out +='st'
elif number % 10==2 and number/10 % 10 !=1:
- out = str(number) +'nd'
+ out +='nd'
elif number % 10==3 and number/10 % 10 !=1:
- out = str(number) +'rd'
+ out +='rd'
else:
- out = str(number) +'th'
+ out +='th'
return out
def list_territories(newLine):
out = ''
for row in run_query(s,()):
- out =out + terr_html(row[0],newLine,0,0) +newLine
+ out += terr_html(row[0],newLine,0,0) +newLine
return out
def list_people_parents():
out = out + 'born in unknown year:' +newLine
for row in run_query(s,()):
if row[2]!=0 and row[2]/100==0:
- out = out +newLine+ 'born in 1st century:' +newLine
+ out +='%sborn in 1st century:%s' % (newLine,newLine)
if row[2]/100!=year/100:
century = row[2]/100 + 1
- out = out +newLine+ 'born in '
+ out +='%sborn in %s century: %s'\
+ %(newLine,ordinal_numbers(century),newLine)
- out = out +ordinal_numbers(century) \
- + ' century:' + newLine
- out = out + name_html(row,newLine) +newLine
+ out+= name_html(row,newLine) +newLine
if row[2] == 0: #unknown year
u = "SELECT diedyear FROM people WHERE ID = ?;"
bornAfter = 0
+ bornBefore = 0
for r in run_query(u,t):
if r[0] !=0:
- out = out + "died: "\
- + str(r[0]) + newLine
bornAfter = r[0] -100
-
+ bornBefore = r[0]
+ out += "Died: %s %s"\
+ %(r[0],newLine)
#find children
u = "Select people.bornYear from"\
+" people INNER JOIN parents"\
if r[0] != 0:
hadChild.append(r[0])
- bornBefore = 0
if len(hadChild)!=0:
- out = out + "had children in: "
+ out += "had children in: "
for c in hadChild:
- out = out + str(c) + ','
+ out+= '%s,' % (c)
out = out[:-1] + newLine
-
bornBefore = hadChild[0]-12
if bornAfter==0:
bornAfter = hadChild[0]-100
+" ORDER BY styles.startYear;"
for r in run_query(u,t):
- out = out + r[1] + " from " + str(r[0])\
- + newLine
+ out += "%s from %s %s"\
+ %(r[1],r[0],newLine)
if bornAfter ==0:
bornAfter = r[0] -100
break
if bornAfter!=0:
if bornBefore == 0:
- out = out + "probably born "\
- +"after " + str(bornAfter)
+ out += "probably born after %s"\
+ %(bornAfter)
else:
- out = out + "probably born "\
- +"betwen " + str(bornAfter)\
- +" and " + str(bornBefore)
+ out +="probably born between %s and %s"\
+ %(bornAfter, bornBefore)
out = out + newLine
year = row[2]
out = ''
for row in run_query(s,()):
- out = out + print_name_count(row,newLine)
+ out += print_name_count(row,newLine)
return out
out = ''
for row in run_query(s,()):
- out = out + print_children_count(row,newLine)
+ out += print_children_count(row,newLine)
return out
def parents_with_children(nChildren,newLine):
+" WHERE parentID = ?"\
+" AND (diedyear-bornyear>? OR died='present');"
- out = "People who had " + str(nChildren)
- if nChildren==1:
- out = out + " child"
- else:
- out = out + " children"
- out = out + ':' + newLine
-
-
+ out = "People who had %s %s:%s" \
+ %(nChildren,print_children(nChildren),newLine)
for row in run_query(s,(nChildren,)):
- out = out + name_html(row,newLine)
+ out += name_html(row,newLine)
for r in run_query(u,(row[1],1)):
out += " %d survived infancy" % r[0]
for r in run_query(u,(row[1],18)):
- out = out +" and " +str(r[0])+" survived to adulthood"
+ out += " and %s survived to adulthood" % r[0]
out = out +newLine
return out
+" FROM people"\
+" WHERE name LIKE ?;"
- out = ''
IDs=[]
names=[]
- out = out + 'Names starting with ' + name + ':' + newLine
+ out = 'Names starting with %s:%s' % (name,newLine)
t = (name + '%',)
fullIDs=[]
for row in run_query(s,t):
- out = out + name_html(row,newLine) + newLine
+ out += name_html(row,newLine) + newLine
fullIDs.append(row[1])
names.append(row[0])
IDs.append(row[1])
t = ('%' + name + '%',)
- out = out+newLine + 'Names containing ' + name + ':' + newLine
+ out += '%sNames containing %s:%s' %(newLine,name,newLine)
for row in run_query(s,t):
if row[1] not in fullIDs:
- out = out + name_html(row,newLine) + newLine
+ out += name_html(row,newLine) + newLine
names.append(row[0])
IDs.append(row[1])
+" FROM people INNER JOIN styles"\
+" ON styles.id = people.id"\
+" WHERE style LIKE ?;"
- out = out +newLine+ 'Styles containing ' + name + ':' + newLine
+ out += '%sStyles containing %s:%s' %(newLine,name,newLine)
for row in run_query(s,t):
- out = out + name_html(row,newLine)+' ' + row[2] + newLine
-
+ out +="%s %s %s" %(name_html(row,newLine),row[2],newLine)
return [out,names,IDs]
t = (name,)
for row in run_query(s,t):
- out = out + name_html(row,newLine) + newLine
+ out += name_html(row,newLine) + newLine
return out
out = ''
for row in run_query(s,()):
month = month_numbers(row[0])
- out = out + month + ': ' + str(row[1]) + newLine
+ out += "%s:%s%s" %( month,row[1],newLine)
if row[0]>12:
u = (row[0],)
- out = out +print_query(t,u,newLine)
+ out +=print_query(t,u,newLine)
return out
out = ''
for row in run_query(s,()):
month = month_numbers(row[0])
- out = out + month + ': ' + str(row[1]) + newLine
+ out += '%s:%s%s'%(month,row[1], newLine)
if row[0]>12:
u = (row[0],)
- out = out +print_query(t,u,newLine)
+ out +=print_query(t,u,newLine)
return out
out = ''
for row in run_query(s,()):
- out = out + print_age_child_count(row,newLine)
+ out +=print_age_child_count(row,newLine)
return out
out = ''
out = 'At age ' + str(age) + ' :'
for row in run_query(s,t):
- out = out + newLine
- out =out + name_html([row[3],row[4]],newLine) + ' had '\
- +name_html([row[1],row[2]],newLine)
-
+ parent = name_html([row[3],row[4]],newLine)
+ child = name_html([row[1],row[2]],newLine)
+ out += "%s%s had %s" % (newLine,parent,child)
return out
def count_age_at_death(newLine):
+" GROUP BY age;"
out=''
for row in run_query(s,()):
- out = out + print_age_death_count(row,newLine)
+ out += print_age_death_count(row,newLine)
return out
out =''
out = 'These people died at age ' +str(age) + ' :'
for row in run_query(s,t):
- out = out +newLine
- out = out + name_html([row[1],row[2]],newLine)
+ out += newLine+ name_html([row[1],row[2]],newLine)
return out
def all_ancestors(personID,newLine):
out = "Ancestors of "
for row in run_query(t,id):
- out = out + name_html(row,newLine)+newLine
+ out += name_html(row,newLine)+newLine
while len(ancestors)>0:
level = level+1
newA =[]
- thisout = newLine + parent_level(level,'parent') +\
- ':' + newLine
+ thisout = "%s %s:%s" \
+ % (newLine,parent_level(level,'parent'),newLine)
+
for ancestor in ancestors:
[parents, parentIDs,parentNames] \
= find_parents(ancestor)
for i in range(len(parents)):
r = [parentNames[i],parentIDs[i]]
- thisout = thisout + \
- name_html(r,newLine)+newLine
+ thisout +=name_html(r,newLine)+newLine
if r[1] not in allAncestors\
and r[1]!=0:
trackLevel.append(level)
ancestors = newA
- out = out+thisout
+ out +=thisout
- image = "<img src = ancestorGraph.py?id="+str(personID)+">"
- out = out+newLine + image+newLine
+ image = "<img src = ancestorGraph.py?id=%s>" %personID
+ out +=newLine + image+newLine
return [out, allAncestors,trackLevel]
for id in (IDA,IDB):
t = (id,)
for row in run_query(s,t):
- out = out + name_html(row,newLine)+newLine
+ out += name_html(row,newLine)+newLine
names.append(row[0])
if id==IDA:
- out = out + 'and'
+ out += 'and'
out = out + newLine
if len(names)!=2:
related = 'No details held on one party'
- out = out + related
+ out += related
return [out,[],related]
+" FROM people"\
+" WHERE ID IN ("
for i in range(len(common)):
- s = s+ "?,"
+ s += "?,"
if len(common)>0:
s = s[:-1]
s = s+") ORDER BY bornyear;"
if len(common)==0:
- related = names[0]+' and '+names[1]+' are not related'
+ related = '%s and %s are not related' %(names[0], names[1])
out = out + newLine + related
return [out, common,related]
- out = out + print_tagged_query('',s,common,newLine)
+ out += print_tagged_query('',s,common,newLine)
indexA=[]
indexB=[]
+" FROM people"\
+" WHERE id=?"
- out = out + newLine + 'Most Recent Common Ancestors:' + newLine
+ out += '%sMost Recent Common Ancestors:%s' %(newLine,newLine)
mrca = []
for a in indexA:
t = (common[a],)
mrca.append(common[a])
- out = out + print_tagged_query('',s,t,newLine)
+ out += print_tagged_query('',s,t,newLine)
if a!=indexA[-1]:
- out = out + 'and' + newLine
+ out += 'and' + newLine
- out = out + parent_level(aLevels[indexA[0]],'parent')
+ out += parent_level(aLevels[indexA[0]],'parent')
if len(indexA) >1:
- out = out + 's'
+ out += 's'
- out = out + ' of ' + name_html([names[0],IDA],newLine)+newLine
+ out +=' of %s%s'%( name_html([names[0],IDA],newLine),newLine)
- out = out + parent_level(bLevels[indexB[0]],'parent')
+ out += parent_level(bLevels[indexB[0]],'parent')
if len(indexB)>1:
- out = out + 's'
- out = out + ' of ' + name_html([names[1],IDB],newLine)+newLine
+ out += 's'
+ out += ' of %s%s' %(name_html([names[1],IDB],newLine),newLine)
al = aLevels[indexA[0]]
bl = bLevels[indexB[0]]
related = relationship(al,bl,names)
- out = out+newLine + related
+ out +=newLine + related
image = "<img src = jointAncestorGraph.py?id="+str(IDA)\
+"&id2="+str(IDB) + "&LA=" + str(min(aLevels)) \
+"&LB=" + str(min(bLevels))+">"
+ image = "<img src = jointAncestorGraph.py?id=%s&id2=%s&LA=%d&LB=%d>"\
+ %(IDA,IDB,min(aLevels),min(bLevels))
- out = out+newLine + image+newLine
+ out +=newLine + image+newLine
return [out,common,related]
def relationship(level1, level2,names):
if level1==0 and level2==0:
- return names[0] + ' is ' +names[1]
+ return "%s is %s" %(names[0],names[1])
if level1==0:
- return names[0] + ' is ' + names[1] + '\'s '+ parent_level(level2,'parent')
+ return "%s is %s's %s" \
+ %(names[0],names[1],parent_level(level2,'parent'))
+
if level2==0:
- return names[1] + ' is ' + names[0] + '\'s '+ parent_level(level1,'parent')
+ return "%s is %s's %s" \
+ %(names[1],names[0],parent_level(level1,'parent'))
if level1>=level2:
if cousinNum==0:
uaLevel = parent_level(remove,'uncle or aunt')
if level1<= level2:
- return names[0] + ' is ' + names[1] + '\'s ' + uaLevel
+ return "%s is %s's %s" % (names[0],names[1],uaLevel)
if level2<level1:
- return names[1] + ' is ' + names[0] + '\'s ' + uaLevel
+ return "%s is %s's %s" % (names[1],names[0],uaLevel)
c=ordinal_numbers(cousinNum)
if remove == 1:
else:
rem = str(remove) + ' times'
- r = names[0] +' and '+names[1] +' are ' + c + ' cousins '
+ r = "%s and %s are %s cousins" % (names[0],names[1],c)
if remove !=0:
- r = r+ rem + ' removed'
+ r += ' %s removed' % rem
return r
if level ==1:
return out
if type =='parent':
- out = 'grand '+out
+ out = 'grand ' + out
else:
out = 'great '+out
if level ==2:
out = ''
for row in run_query(tq,(aTerritory+'%',)):
if row[4]!=last and last!='':
- out = out + 'Rulers of '+terr_html(last,newLine,0,0) \
- +':'+ newLine +thisT +newLine
- thisT = ''
+ out += 'Rulers of %s:%s%s%s'\
+ %(terr_html(last,newLine,0,0),newLine,thisT,newLine)
+ thisT = ''
- thisT = thisT +name_html(row,newLine)
- thisT = thisT +' from ' + str(row[2])+' to '+str(row[3]) + newLine
+ thisT += "%s from %s to %s%s" \
+ % (name_html(row,newLine),row[2],row[3],newLine)
last = row[4]
- out = out + 'Rulers of '+terr_html(row[4],newLine,0,0) +':'+ \
- newLine +thisT
+ out += 'Rulers of %s:%s%s' \
+ % (terr_html(row[4],newLine,0,0),newLine,thisT)
return out
#Id, Name, Dates, Style, Style-Dates
s = "SELECT * FROM people WHERE ID = ?"
for row in run_query(s,t):
- mainDiv = mainDiv + startP
- mainDiv = mainDiv + 'ID: '+str(row[0]) +newLine
- mainDiv = mainDiv + print_tagged_name('Name',[row[1], row[0]]\
+ mainDiv += startP
+ mainDiv += 'ID: %s%s' %(row[0] ,newLine)
+ mainDiv += print_tagged_name('Name',[row[1], row[0]]\
,newLine)
- mainDiv = mainDiv + endP
+ mainDiv +=endP
name = row[1]
url = row[9]
picture = row[10]
- mainDiv = mainDiv + startP
- mainDiv = mainDiv + newLine + 'Born: '+row[3] + newLine
+ mainDiv += startP
+ mainDiv += '%sBorn:%s%s '% (newLine,row[3],newLine)
bornYear = row[4]
- mainDiv = mainDiv + 'Died: '+row[5]
+ mainDiv +='Died: %s' % row[5]
if row[6] != 0 and row[4] !=0:
- mainDiv = mainDiv + ", aged " \
- +str(row[6]-row[4])
- mainDiv = mainDiv + endP
+ mainDiv += ", aged %s" %(row[6]-row[4])
+ mainDiv +=endP
s = "SELECT * FROM styles WHERE ID = ?"
for row in run_query(s,t):
- mainDiv = mainDiv + startP
- mainDiv = mainDiv +newLine+ 'Style: '+row[1] + newLine
+ mainDiv += startP
+ mainDiv +='%sStyle: %s%s'%(newLine,row[1],newLine)
- mainDiv = mainDiv + 'Territories:' + newLine
+ mainDiv += 'Territories:%s' % newLine
u = "SELECT * FROM territories"\
+" WHERE ID =? AND startYear =? AND stopYear=?"
any = 0
for r in run_query(u,v):
- mainDiv = mainDiv \
- + terr_html(r[1],newLine,r[3],r[5])\
- +','
+ mainDiv += terr_html(r[1],newLine,r[3],r[5]) +','
any = 1
if any ==1:
mainDiv = mainDiv[:-1] + newLine
- mainDiv = mainDiv + 'From: '+row[2] + newLine
- mainDiv = mainDiv + 'To: '+row[4]
+ mainDiv += 'From: '+row[2] + newLine
+ mainDiv += 'To: '+row[4]
- mainDiv = mainDiv + endP
+ mainDiv += endP
- mainDiv = mainDiv + startP
+ mainDiv += startP
s = "SELECT people.Name,consort "\
+"FROM consorts LEFT JOIN people"\
+" ON people.ID = consorts.consort"\
+" WHERE consorts.ID = ?"
for row in run_query(s,t):
- mainDiv = mainDiv + print_tagged_name\
+ mainDiv += print_tagged_name\
('Consort of',row,newLine)
- mainDiv = mainDiv + endP
+ mainDiv += endP
#find parents
[parents,parentIDs,parentNames] = find_parents(personID)
- mainDiv = mainDiv + startP
+ mainDiv += startP
for i in range(len(parents)):
r = [parentNames[i],parentIDs[i]]
- mainDiv = mainDiv + print_tagged_name('Parent',r,newLine)
- mainDiv = mainDiv + endP
+ mainDiv += print_tagged_name('Parent',r,newLine)
+ mainDiv += endP
#find spouses
[spouses,spousesID,spousesNames] = find_spouses(personID)
- mainDiv = mainDiv + startP
+ mainDiv += startP
for i in range(len(spouses)):
r = [spousesNames[i],spousesID[i]]
- mainDiv = mainDiv + print_tagged_name('Spouse',r,newLine)
- mainDiv = mainDiv + \
+ mainDiv += print_tagged_name('Spouse',r,newLine)
+ mainDiv += \
relationship_html(personID,r[1],newLine)
mainDiv = mainDiv + endP
opr=[names[i][1],IDs[i][1]]
top = names[i][1]
if i==0 or top != names[i-1][1]:
- mainDiv = mainDiv +endP
- mainDiv = mainDiv + startP
- mainDiv = mainDiv + print_tagged_name\
+ mainDiv +=endP
+ mainDiv += startP
+ mainDiv += print_tagged_name\
('With',opr, newLine)
age = cb-bornYear
thisChild = thisChild[:-4] + \
" at the age of "+str(age) + newLine
- mainDiv = mainDiv + thisChild
+ mainDiv += thisChild
- mainDiv = mainDiv + endP
+ mainDiv += endP
if newLine == '<br>':
output = '<div id = "main" style = " float:left">';
- output = output + mainDiv + "</div>"
+ output += mainDiv + "</div>"
- output = output + "<div id = 'image' "\
+ output += "<div id = 'image' "\
+"style = 'float:left; margin-left:20px'>"
imageDiv = ''
if picture!='.':
- imageDiv = imageDiv + "<a href=" + url+">"\
+ imageDiv += "<a href=" + url+">"\
+"<img src=" + picture +" alt = 'wiki link'"\
+" title = 'wiki link'></a>"\
+ newLine
elif url!='.' and url!='. ':
- imageDiv = imageDiv + "<a href=" + url +">"\
+ imageDiv += "<a href=" + url +">"\
+name + " (wiki link)</a>"+newLine
- output = output + imageDiv + "</div>"
+ output += imageDiv + "</div>"
url = 'http://www.chiark.greenend.org.uk/ucgi/~naath/'\
+'smallGraph.py'
form = ''
- form = form + "<form id ='controlForm'"\
+ form += "<form id ='controlForm'"\
+" action ="+ url +" method = 'get'>"
- form = form +\
+ form +=\
"<input type = 'hidden' name = 'ID' value = "\
+personID + "><br>"
- form = form +\
+ form +=\
"Generations of Parents: "\
+"<input type = 'text' name = 'pl' value='1'>"
- form = form + newLine
- form = form + \
+ form += newLine
+ form += \
"Generations of Children: "\
+" <input type = 'text' name = 'cl' value = '1'>"
- form = form + newLine
- form = form + \
+ form += newLine
+ form += \
"Show siblings: <select name = 's'>"+\
"<option value = '0'>No</option>"+\
"<option value = '1'>Yes</option>"+\
"</select>"
- form = form + newLine
- form = form + \
+ form += newLine
+ form += \
"Show spouse's other spouses: <select name = 'os'>"+\
"<option value = '0'>No</option>"+\
"<option value = '1'>Yes</option>"+\
"</select>"
- form = form + newLine
- form = form + \
+ form += newLine
+ form += \
"Show parents' other spouses: <select name = 'pos'>"+\
"<option value = '0'>No</option>"+\
"<option value = '1'>Yes</option>"+\
"</select>"
- form = form + newLine
- form = form + \
+ form += newLine
+ form += \
"Fount size: "+\
"<input type = 'text' name = 'fs' value='8'>"
- form = form + newLine
- form = form + "</form>"
+ form += newLine
+ form += "</form>"
graph = "smallGraph.py?ID="+str(personID)+"&fs=8"
graph = "<img src ="+ graph + '>'
- output = output + "<div id = 'graph' style = 'clear:both'>"
- output = output + "<p id = 'agraph'>"+graph+"</p>"
- output = output + "Draw this graph with more relatives:"
- output = output + newLine + form
+ output += "<div id = 'graph' style = 'clear:both'>"
+ output += "<p id = 'agraph'>"+graph+"</p>"
+ output += "Draw this graph with more relatives:"
+ output += newLine + form
- output = output + "<button onclick='myFunction()'>"+\
+ output += "<button onclick='myFunction()'>"+\
"Go</button>"
- output = output + "</div>"
+ output += "</div>"
- output = output +\
+ output +=\
'<script>'+\
'function myFunction()'+\
'{'+\