[Tutor] python cgi single double quotes

nitin chandra nitinchandra1 at gmail.com
Wed Jul 20 04:23:12 EDT 2016


Hi Alan,


vimal at Ubuntu-1404-trusty-64-minimal:~$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.version
2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2]
>>>

Should I test the above from within html code too ?

Also, for testing and configuration purpose, I have set 755 / 777
permissions to dir / files respectively.

Thank you,

Nitin Chandra



On 20 July 2016 at 00:46, Alan Gauld via Tutor <tutor at python.org> wrote:
> 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?
>
> Try
>
> 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
> http://www.alan-g.me.uk/
> http://www.amazon.com/author/alan_gauld
> Follow my photo-blog on Flickr at:
> http://www.flickr.com/photos/alangauldphotos
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list