Skip to content

format code with autopep8 #2800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions port scanner/port_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import argparse
from datetime import datetime


def scan_ports(target, ports):
open_ports = []
for port in ports:
Expand All @@ -15,11 +16,11 @@ def scan_ports(target, ports):
return open_ports



def main():
parser = argparse.ArgumentParser(description="Simple port scanner.")
parser.add_argument("target", help="Target IP address to scan.")
parser.add_argument("-p", "--ports", type=str, default="1-100", help="Port range to scan (e.g., '1-100').")
parser.add_argument("-p", "--ports", type=str, default="1-100",
help="Port range to scan (e.g., '1-100').")
args = parser.parse_args()

target = socket.gethostbyname(args.target)
Expand Down Expand Up @@ -49,5 +50,6 @@ def main():
print("Server not responding!")
sys.exit()


if __name__ == "__main__":
main()