annotate pycaptcha/simple_example.py @ 90:e352a98fcc0a

Il y a maintenant une proba de 0.3 d'effectuer le bruitage. De plus, comme cette nouvelle fonctionnalite demande un parametre non-deterministe, les deux fonctions 'determined_by_complexity' ont ete enlevees. Le module se comporte comme un module conventionnel
author SylvainPL <sylvain.pannetier.lebeuf@umontreal.ca>
date Thu, 11 Feb 2010 09:08:16 -0500
parents 4775b4195b4b
children
rev   line source
87
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
1 #!/usr/bin/env python
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
2 #
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
3 # A very simple example that creates a random image from the
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
4 # PseudoGimpy CAPTCHA, saves and shows it, and prints the list
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
5 # of solutions. Normally you would call testSolutions rather
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
6 # than reading this list yourself.
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
7 #
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
8 from Captcha.Visual.Tests import PseudoGimpy, AngryGimpy
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
9 import numpy
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
10 #from numpy import *
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
11
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
12 #g = AngryGimpy()
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
13 #i = g.render()
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
14 #a = numpy.asarray(i)
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
15 #b = numpy.zeros((2, 2), numpy.int8)
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
16 #c = a == b
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
17 #print c
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
18 #i.save("output.png")
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
19 #i.show()
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
20 #print a
4775b4195b4b code pour la generation de captchas
goldfinger
parents:
diff changeset
21 #print g.solutions