Python CGI running commands under NT

Pieter Claerhout PClaerhout at CREO.BE
Thu Apr 13 10:04:33 CEST 2000


Hello,

I made a Python CGI-script that executes a DOS-command and
should return the result in a HTML page. The script looks
as follows:

  import os

  pipe = os.popen("ipconfig", 'r')
  text = pipe.read()
  del pipe

  print "Content-type: text/html"
  print
  print "IPConfig on AV2700"
  print "<br>"

  print '<pre>'
  print text
  print '</pre>'

If I run this script from the command line, it works fine, but
when I open it using Internet Information Server, all is shown
except the contents of the variable text. Any ideas what could
be wrong? Is it maybe a setting in IIS or are these options
not allowed in CGi-scripts?

Kind regards,


Pieter
Pieter_Claerhout at creoscitex.com




More information about the Python-list mailing list