Latest
Loading...

Python for Ethical Hacking

Command Prompt

Featured Post

#5 Jarvis

Jarvis      Now we are going to create some functions. With the help of this functions we are going to make our Play music Open website...

#11 Using If condition in MAC Changer || Python for Hacking

#11 Using If condition in MAC Changer || Python for Hacking

 Python for Hacking

MAC Changer

If Condition in MAC Changer


Why we use if condition in MAC Changer

                             If we forgot to give any value needed for the MAC Changer tool the error will occur and it is somewhat difficult to understand for beginner. To make clarity for user we use if statement to make a two error statement for not giving interface and mac address.

Commands


def get_arguments():
    parser = optparse.OptionParser()
    parser.add_option("-i", "--interface", dest="interface", help="Interface you want to change")
    parser.add_option("-m", "--mac", dest="new_mac", help="Enter the New MAC Address")
    (options, arguments) = parser.parse_args()
    if not options.interface:
        parser.error("Please Enter the value of Interface, Check --help for more info")
    elif not options.new_mac:
        parser.error("Please Enter the value of new mac, Check --help for more info")
    return options

We add if statement in get_argument function. Do get detailed knowledge watch video in below.




No comments:

Post a Comment