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
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
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
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
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\
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
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
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
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