mirror of
https://github.com/ghndrx/nmap.git
synced 2026-02-10 06:55:03 +00:00
Update nmap.py
I have changed the if-else statement in the menuSelector() function to a switch statement, using a python dictionary. The switch statement checks if the menuChoice variable exists as a key in the dictionary and returns the corresponding value,
This commit is contained in:
14
nmap.py
14
nmap.py
@@ -37,12 +37,14 @@ Anything else to exit.
|
|||||||
|
|
||||||
def menuSelector():
|
def menuSelector():
|
||||||
menuChoice = input("Choose from above")
|
menuChoice = input("Choose from above")
|
||||||
if menuChoice == "0": print("0.Selected Host Discoverer...")
|
switch = {
|
||||||
elif menuChoice == "1": print("1.Selected Full Scan...")
|
"0": "0.Selected Host Discoverer...",
|
||||||
elif menuChoice == "2": print("2.Selected TCP Connect...")
|
"1": "1.Selected Full Scan...",
|
||||||
elif menuChoice == "3": print("3.Selected TCP Violation...")
|
"2": "2.Selected TCP Connect...",
|
||||||
elif menuChoice == "4": print("4.Selected Masscan...")
|
"3": "3.Selected TCP Violation...",
|
||||||
else: print("Exiting...")
|
"4": "4.Selected Masscan..."
|
||||||
|
}
|
||||||
|
print(switch.get(menuChoice, "Exiting..."))
|
||||||
return menuChoice
|
return menuChoice
|
||||||
|
|
||||||
def cmdList():
|
def cmdList():
|
||||||
|
|||||||
Reference in New Issue
Block a user