Numbers
  • Home
#!/usr/bin/env python import cgi header = 'Content-Type: text/html\n\n' formhtml = ''' Lotto picks just for your (static screen)

Lotto picks just for you!

Enter your Name:

Enter a lucky number, person, place or thing to help in calculating your lotto number picks: %s

''' fradio = ' %s\n' def showForm(): friends = [] for i in (0, 10, 25, 50, 100): checked = '' if i == 0: checked = 'CHECKED' friends.append(fradio % (str(i), checked, str(i))) print '%s%s' % (header, formhtml % ''.join(friends)) reshtml = ''' Lotto picks just for your (static screen)

Lotto picks calculated for: %s

Your name is: %s

You have %s friends. ''' def doResults(who, howmany): print header + reshtml % (who, who, howmany) def process(): form = cgi.FieldStorage() if 'person' in form: who = form['person'].value else: who = 'NEW USER' if 'howmany' in form: howmany = form['howmany'].value else: howmany = 0 if 'action' in form: doResults(who, howmany) else: showForm() if __name__ == '__main__': process()

Site powered by Weebly. Managed by Hostmonster
Photo from elizaIO