cgi-script:
Code: Alles auswählen
#!C:\Programme\xampp\python\python.exe
import sys, os, traceback, cgi
sys.stderr = sys.stdout
def main():
sys.stderr = sys.stdout
# os.chdir(os.path.join("D:\","workdir","builder","Python"))
print "Content-type: text/html\n\n"
form = cgi.FieldStorage() #parse query
if form.has_key("build") and form["build"].value != "":
print os.system("D:\\workdir\\builder\\Python\\builder.py "+ form["build"].value)
print
print "<h1> Build-Script </h1><br>"
print "Script is starting: build.py ", form["build"].value, "<br>"
print form["name"].value, ", thank you for using this Script <br>"
else:
print "<h1> Error! Please Enter Parameter.</h1>"
main()
Code: Alles auswählen
<form method="POST" action="http://localhost/cgi-bin/loader.cgi">
<p>build.py <input type="text" name="build" value="">
<p>Click here to submit form: <input type="submit" value="Yeah!">
<input type="hidden" name="session" value="1f9a2">
</form>
Code: Alles auswählen
1
Build-Script
Script is starting: build.py Simulator ConsoleCoach all
sdf , thank you for using this Script
mit freundlichem Gruß
Zack