Skip to main content

Generate Captcha Using Python

 


Generate Captcha Using Python:

       Captcha is very Helpful in Web applications to provide security. It used to avoid network attacks. Python Captcha module is used to create both audio and image captcha. In this project we create image captcha by using python captcha module. 

Installation:

    $ pip install captcha

Step-1:

    importing modules
    
    from captcha.image import ImageCaptcha

Step-2:

    Create an image instance of given size
    
    image= ImageCaptcha(width=280,height=90)

Step-3:

    Image captcha text

    captcha_text=input("Enter Captcha text\n")

Step-4:

    Generate the image for given text

    data=image.generate(captcha_text)

Step-5:

    Write the image on the given file and save it
    
    image.write(captcha_text,'caption.png')

Step-6:

    Execution

    $python captcha.py
    $Enter captcha Text
    >createcoder

Output:




To Download Overall Source Code for above Project  Clickhere





Note:
    Hello Guys, Don't Stop Learning keep Going..............







Popular posts from this blog

Shutdown, Restart, Logout System Using Python GUI

  Shutdown, Restart, Logout System Using Python GUI:        We Can Shutdown, Restart, Logout A computer Using Python GUI.  Python with tkinter is the fastest and easiest way to create the GUI applications. Creating a GUI using tkinter is an easy task. Step-1:      importing modules          from tkinter import *     import os Step-2:      User Define Functions for execute Shutdown, Restart, Logout          def shutdown():           return os. system("shutdown -s -t 1")      def restart(): return os. system("shutdown -r -t 1")      def logout(): return os. system("shutdown -l") Step-3:      Create tkinter Object and setup geometry    master=Tk()     master. geometry("200x200") Step-4:     Setting Background to grey    master.c onfigure(bg='light gr...

Python Program to Convert Hectare to Acre

             Python Program to Convert Hectare to Acre       Generally 1 hectare = 2.471 acres. It is used find the area of the lands or farming. It is comes under unit conversions.       Input:          1      Out put:           2.471044            Explanation :                    Generally 1 hectare = 2.471044 acres                       Code:          hectare=int(input())           print(hectare*2.471044)           Note:     Hello Guys, Don't Stop Learning keep Going..............

Python Program to check given number is Prime Number or Not

     Python Program to check given number is Prime Number or Not       A number Greater than 1 which has only two factors. They are 1 and itself. In computer science prime number concept is very interesting and most important in cryptography.          Input:          7      Out put:          prime         Explanation :           Factors for 7 is 1 and itself then it is prime number.      Code:         x=int(input()) c=0 for i in range(2,x):      if(x%i==0):           c=1           break if(c==1):      print("not a prime") else:      print("prime") Note:     Hello Guys, Don't Stop Learning keep Going..............