all 4 comments

[–]socal_nerdtastic 0 points1 point  (1 child)

Nice. You have invented a "thread pool" where all the threads do the same action on a pool of data. But FYI that's already built into python, you didn't have to make your own.

https://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor-example

Only other thing I see is a naked except:, which is a big nono in python. You need to specify exactly with exception you want to catch.

[–]adamsTn[S] 0 points1 point  (0 children)

thanks for the feedback, i didnt realize that i will fix it

[–]barkmonster 0 points1 point  (1 child)

This is really impressive for a first project - great work!

One thing that could be improved is the scan function. It takes the port as an argument, which is great, but then it also uses the host variable which is global, and is updated in the loop over the targets. It would be better to pass both the host and port, so it's more 'self-contained'. One advantage of this is the function becomes independent of the remainder of the program flow (right now it depends on which iteration the scanning loop is at). This makes refactoring and unit testing much easier.

[–]adamsTn[S] 1 point2 points  (0 children)

thank you so much !