IOT, Shodan and public networks

If I understand it right.
You can simply find devices inside of a network with nmap.

But simply Spinning up a Python Webserver will only start a HTTP Server in your lokal network.