0

I want to be able to execute my python script on the client's machine when they access my website but haven't been able to find a solution that works.

import urllib.request, urllib.error, urllib.parse

url = "http://ip4only.me/api/"

response = urllib.request.urlopen(url)
webContent = response.read()
  • If the user is accessing your website throug a browser, then you can probably do it with javascript. the user need to have downloaded your script in an executeable format that can run on his computer, and then you can use JS to execute the script throug the browser. btw. python is not good for this kind of stuff. You should use a client side language instead, since python is serverside, it is not good :) – mama Aug 18 '20 at 14:40
  • 1
    There is a reason why you don't have access to a clients machine just through your website, that would have major security implications. – empiric Aug 18 '20 at 14:41
  • If your goal is to just get the clients IP address via your website, have a look at [this](https://stackoverflow.com/q/391979/4202224) question – empiric Aug 18 '20 at 14:43

0 Answers0