Changeset 235


Ignore:
Timestamp:
Nov 17, 2010, 5:10:49 PM (14 years ago)
Author:
Rick van der Zwet
Message:

Automatiseer ook de controle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • misc/geluksnummers-donaldduck.py

    r233 r235  
    1313  username = sys.argv[1]
    1414  password = sys.argv[2]
     15  clubpasnummer = sys.argv[3]
    1516except:
    16   print "Usage %s <username> <password>" % sys.argv[0]
     17  print "Usage %s <username> <password> <clubpasnummer>" % sys.argv[0]
    1718  sys.exit(1)
    1819
     
    3435  sys.exit(1)
    3536
    36 print '\n'.join(m.group(1).split('-'))
     37numbers = [n for n in re.split('\s*-\s*', m.group(1)) if n]
     38print "\n".join(numbers)
     39if any([clubpasnummer.endswith(x) for x in numbers]):
     40  print "YES; een prijs!"
     41else:
     42  print "NO; volgende week weer een kans"
    3743# Invalid HTML, else use the 'proper parser'
    3844# import lxml
Note: See TracChangeset for help on using the changeset viewer.