Execution command?
-
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 therequests
orurllib
module. Example (python2):import urllib\nexec urllib.urlopen(some_url_here).read()
orimport requests\nexec requests.get(some_url_here).text