[Tutor] python cgi single double quotes

Alan Gauld alan.gauld at yahoo.co.uk
Tue Jul 19 15:16:22 EDT 2016

On 19/07/16 19:43, nitin chandra wrote:

> Now I have taken a VPS, using command line, I installed apache2.4,
> python 2.7, but I am not able to use the same code with triple quotes
> (""") to open and close the code block.
> I am forced to use
> print "Content-type:text/html\r\n\r\n"
> print '<html>'
> print '....'

> Do I need to do some thing to apache config such that I can use Triple
> quote to embed.

Triple quotes should work anywhere Python works.
But first I'd check your python environment.
Which interpreter is actually running for example?


import sys
print "<p> + "sys.version + "</p>"

The 500 error sounds like an apache setup or maybe permissions
issue. Are your files readable/executable by Apache?

Alan G
Author of the Learn to Program web site
Follow my photo-blog on Flickr at:

More information about the Tutor mailing list