Re: [Tutor] python cgi single double quotes

2016-07-20 Thread nitin chandra
Me a little embarrassed :P ... but now when I retyped the code ... it seems to be working Alan, Peter .. .Thank you. On 20 July 2016 at 17:24, Peter Otten <__pete...@web.de> wrote: > nitin chandra wrote: > >> Ran both the method > > So everything seems to be working as expected. When you go

Re: [Tutor] python cgi single double quotes

2016-07-20 Thread Peter Otten
nitin chandra wrote: > Ran both the method So everything seems to be working as expected. When you go back to your original script you can enable tracebacks rendered as html with #!/usr/bin/env python import cgitb cgitb.enable() ... # your code Provided there are no syntax errors in the scrip

Re: [Tutor] python cgi single double quotes

2016-07-20 Thread nitin chandra
Ran both the method #!/usr/bin/env python import cgi import psycopg2 import sys print """Content-type:text/html\r\n\r\n""" print """ Hello Word - First CGI Program Hello Word! This is my first CGI program {version} First name: """.format(version=sys.version) and its output (below) nitin@n

Re: [Tutor] python cgi single double quotes

2016-07-20 Thread Peter Otten
nitin chandra wrote: > On inserting the line ... > > print " + "sys.version + "" > > required slight correction > > print "" + sys.version + "" > > and the following script and its output are below :- > > #!/usr/bin/env python > > import sys > import c

Re: [Tutor] python cgi single double quotes

2016-07-20 Thread nitin chandra
On inserting the line ... print " + "sys.version + "" required slight correction print "" + sys.version + "" and the following script and its output are below :- #!/usr/bin/env python import sys import cgi import psycopg2 print "Content-type:text/html\

Re: [Tutor] python cgi single double quotes

2016-07-20 Thread Alan Gauld via Tutor
On 20/07/16 09:23, nitin chandra wrote: > vimal@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 2

Re: [Tutor] python cgi single double quotes

2016-07-20 Thread nitin chandra
Hi Alan, vimal@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 t

Re: [Tutor] python cgi single double quotes

2016-07-19 Thread Alan Gauld via Tutor
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

[Tutor] python cgi single double quotes

2016-07-19 Thread nitin chandra
Hi I wrote python+cgi script on hostgator server and I could embed html like:- code folder :- /home/userName/public_html/*.cgi #!/usr/bin/env python print "Content-Type:text/html\n\n" print print """ ... ... """ The above style / way of coding works. Even on my laptop where the code is i