Attachment 'explore.py'

Download

   1 #!/usr/bin/python2.3
   2 
   3 import os.path
   4 import os
   5 import sys
   6 
   7 try:
   8     __file__
   9 except NameError:
  10     __file__ = '?'
  11 
  12 print """Content-type: text/html
  13 
  14 <html><head><title>Python Exploration</title></head><body>
  15 <table border=1>
  16 <tr><th colspan=2>1. System Information</th></tr>
  17 <tr><td>Python</td><td>%s</td></tr>
  18 <tr><td>Platform</td><td>%s</td></tr>
  19 <tr><td>Absolute path of this script</td><td>%s</td></tr>
  20 <tr><td>Filename</td><td>%s</td></tr>
  21 """ % (sys.version,
  22        sys.platform,
  23        os.path.abspath('.'),
  24        __file__)
  25 print "<th colspan=2>2. Environment Variables</th>\n"
  26 for variable in os.environ:
  27     print "<tr><td>%s</td><td>%s</td></tr>\n" % (variable, os.environ[variable])
  28 print "</table></body></html>"

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2006-06-06 19:11:34, 0.7 KB) [[attachment:explore.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.