You should probably rename your file
internetScanner. Extensions on *nix are purely optional. It shouldn't matter here.
mv main.py internetScanner
Then, add the following line to this file, right at the beginning:
This will make sure that when the shell executes the file, it will know to use
python3 to interpret the content. This is known as the Shebang. Now, make the file executable:
chmod +x internetScanner
You can now run your program from within
Your program will run in the foreground and continue running until you press Ctrl-C. If you do not want this, you can also start the program in the background, by adding an ampersand after the command:
./internetScanner start &
This will let your program run, but you can continue to use your shell. This is called job control, and there's a simple tutorial about it here.
If you now want to be able to run the program from anywhere on the system, you need to add the
internetScanner directory to your
PATH: What are PATH and other environment variables, and how can I set or use them?