I am trying to create a dynamic page that has to do some work behind the scene/server side and also show a web page where the person can retrieve what we have processed server side. So just as a base template for a page I have this:
#!/usr/bin/python
import cgi, os, sys, commands
print "Content-type: text/html\n";
print "<html>\n"
print "<head>\n"
print "<title>My Title Here</title>\n"
#Need to find out how to get python to get css code done.
print "<![if !IE]> <link href="../styles/screen.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]>\n"
print "</head>\n"
print "<body>\n"
print "<body>\n"
print "</html>\n"
This line print "<![if !IE]> <link href="../styles/screen.css" rel="stylesheet" type="text/css" media="screen" /> <![endif]>\n" Is the one causing problems. How does one use this logical way of finding out and using the css when the page is built in python then served to the user? How do I incorporate css in my pages when done through python?
'around a string if the string contains double quotes".printstatement requires the\nat the end (since the headers must be separated from the content by a blank line). The remainder will be perfectly OK with simply the\nthat theprintstatement automatically adds. You could also look into using triple quotes, to allow you to more easily include quotes in your content.