(Actually, it's a lie. I wrote my first cgi script around 20 years ago.)
Code: Select all
#!/usr/bin/python import datetime import os print "Content-type:text/html\r\n\r\n" print '<html>' print '<head>' print '<title>Hello World - First CGI Program</title>' print '</head>' print '<body>' print '<h2>Hello World! This is my first CGI program</h2>' print 'Todays date is ' print datetime.date.today() print '<p>Or another way:<p>' os.system("date") print '</body>' print '</html>'
The date comes out as expected from the datetime.date.today() but nothing appears from the os.system line.
The answer has got to be incredibly simple but it escapes me for the moment.
Regards - Philip