mirror of
https://github.com/The-Art-of-Hacking/h4cker.git
synced 2024-10-01 01:25:43 -04:00
Define raw_input() for Python 3
In Python 3, __raw_input()__ has been replaced with __input()__ * Also added __.strip()__ to input statements to deal gracefully with leading or trailing spaces.
This commit is contained in:
parent
1c160e4544
commit
9be4666773
@ -9,6 +9,11 @@ from __future__ import print_function
|
||||
|
||||
import socket, subprocess, sys
|
||||
|
||||
try:
|
||||
raw_input # Python 2
|
||||
except NameError:
|
||||
raw_input = input # Python 3
|
||||
|
||||
subprocess.call('clear', shell=True)
|
||||
|
||||
print('''\t
|
||||
@ -25,9 +30,9 @@ print('''\t
|
||||
|
||||
''')
|
||||
|
||||
target_ip = raw_input("\t Please enter the IP address of the target host:")
|
||||
port_1 = int(raw_input("\t Enter the first port to scan:\t"))
|
||||
port_2 = int(raw_input("\t Enter the last port to scan:\t"))
|
||||
target_ip = raw_input("\t Please enter the IP address of the target host:").strip()
|
||||
port_1 = int(raw_input("\t Enter the first port to scan:\t").strip())
|
||||
port_2 = int(raw_input("\t Enter the last port to scan:\t").strip())
|
||||
print("~"*50)
|
||||
print("\n ...scanning target now. ", target_ip)
|
||||
print("~"*50)
|
||||
|
Loading…
Reference in New Issue
Block a user