So, im trying to make a script that takes code from a pastebin post and runs it. But, for some reason it doesnt run the code. I dont know why. Could someone explain why this wont work so i can fix the issue?
I tried: (dont mind the imports im gonna use those for later)
import os
from json import loads, dumps
from base64 import b64decode
from urllib.request import Request, urlopen
from subprocess import Popen, PIPE
def get_code():
test = 'None'
try:
test = urlopen(Request('https://pastebin.com/raw/4dnZntN3')).read().decode()
except:
pass
return test
test = get_code()
def main():
test
main()
The output is empty, and no errors.