Brando
Apr 22, 2017 - 22:10
Is there any way to execute code within a program from a URL? I want to put some code on a google sites then execute that code but is there a command to execute a string?
Is there any way to execute code within a program from a URL? I want to put some code on a google sites then execute that code but is there a command to execute a string?
@Brando you can execute a string with exec. In python2: exec string_here, In python3: exec(string_here).
To download the code, use the requests or urllib module. Example (python2): import urllib\nexec urllib.urlopen(some_url_here).read() or import requests\nexec requests.get(some_url_here).text