if(1 == nextP % 2):
nextP = nextP - 1
str = string[curP:nextP]
curP = nextP
s = '%s<font color="%s" size="%d">%s</font>'%(s, clr, sz, str)
s = '%s<font color="%s" size="%d">%s</font>'%(s, clr, sz, string[curP:])
returns.replace('__', ' ')
@staticmethod
defgetFriendList(lim=3):
ret = []
fori inrange(lim):
surname = random.choice(['Иванов', "Петров", "Сидоров", "Гаврилов", "Корниленко"])
name = random.choice(['Иван', "Петр", "Николай", "Михаил", "Александр"])
lastname = random.choice(['Иванович','Петрович','Георгиевич',"Васильевич","Михаилович"])
rost = random.randint(150, 220)
ves = random.randint(50, 150)
bmi = generator.getBmi(rost, ves)
ret.append({'string': '%s %s %s'%(surname, name, lastname),
'rost': str(rost),
'ves': str(ves),
'size': str(bmi['sz']),
'color': bmi['color'],
})
returnret
@staticmethod
defgenUlUlList():
lst = generator.getFriendList(6)
s = '<ul>'
fori inlst:
s += '<li>%s</li>'%i['string']
s += '</ul>'
s += '<ol>'
fori inlst:
s += '<li style=\'color: %s\'>%s'%(generator.genRndColor(), i['string'])
s += '<ol>'
s += '<li style=\'font-size: %s em;color:%s;\'>Рост: %s</li>'%(i['size'], i['color'], i['rost'])
s += '<li style=\'font-size: %s em;color:%s;\'>Вес: %s</li>'%(i['size'], i['color'], i['ves'])
s += '</ol></li>'
s += '</ol>'
returns
@staticmethod
defgenTable():
lst = generator.getFriendList(3)
s = '<table border=1><thead><tr><td>ФИО</td><td>Значения</td></tr></thead><tfoot>'
fori inlst:
s += '<tr><td>%s</td><td>'%i['string']
s += '<table><tr><td rowspan=2>Рост<br />Вес</td></tr><tr><td style=\'background-color: %s\'>%s</td></tr>'%(i['color'], i['rost'])
s += '<tr><td style=\'background-color: %s\'>%s</td></tr></table>'%(i['color'], i['ves'])
s += '</td></tr>'
s += '</tfoot></table>'
returns
classmyApp(wx.App):
"""
Стандартное приложение
"""
defOnInit(self):
self.SetAppName('NPPlan')
frame = mainWin(None, _('Window title'))
frame.Show()
returnTrue
defmain():
"""
Главная функция
"""
app = myApp(False)
app.MainLoop()
if__name__ == '__main__':
main()