Sharedwww / wiki / attachments / HelpOnInstalling(2f)ApacheOnLinuxFtp / explore.pyOpen in CoCalc
Author: William A. Stein
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>"
29