Reputation: 28786
Its perhaps not the safest thing in the world to do, but assuming risks have been accounted for, what's the simplest way to load an run a python script that is http(s) hosted, from the local machine?
Upvotes: 2
Views: 70
Reputation: 2662
# python 2
from urllib import urlopen
# python 3
from urllib.request import urlopen
page = urlopen('https://DANGEROUS').read()
exec(the_page)
EDIT: @jakekimds was right to point out that exec
is more appropriate than eval
here.
Upvotes: 3