Jump to content


VlexoFree Notice

Interviews will be open every Friday starting at 12am PDT and lasting for 24 hours.

- - - - -

stuff at the top of a web page in python cgi


  • Please log in to reply
3 replies to this topic

#1 leke

leke

    Advanced Member

  • Members
  • 88 posts
  • LocationFinland

Posted 12 June 2009 - 11:27 PM

I managed to set up a working Python CGI script, but wanted to change the stuff at the beginning of the example script (Content-Type: text/html) i was looking at, to a something more like my page...

print '''



'''
print
print'''
Homepage

'''

...but the end result ends up printing the HTML on screen. The python code parses correctly though so i'm doing something right :)

How do I do this?
Thanks.
PS. Here is my test page: http://www.rebol.vle...ack/py_test.cgi

Edited by leke, 13 June 2009 - 06:27 AM.


Ad Bot


      #2 leke

      leke

        Advanced Member

      • Members
      • 88 posts
      • LocationFinland

      Posted 13 June 2009 - 06:25 AM

      I figured it out :) It just took me a while to figure out what I needed to ask google ;)

      So if anyone is interested...

      You add the whole !DOCTYPE thing after:

      print "Content-type: text/html"
      print

      : you see, I assumed Content-type: text/html was just a simplified part of all that junk that lives up at the top of your web page. Now I see it in action, it makes more sense that it is part of the CGI protocol.

      #3 andriy

      andriy

        Member

      • Pre-Members
      • 14 posts

      Posted 11 February 2011 - 06:51 AM

      Hello!
      Could you explain how you set up python cgi?

      #4 andriy

      andriy

        Member

      • Pre-Members
      • 14 posts

      Posted 11 February 2011 - 08:37 AM

      I found the reply and posted on http://vlexoforums.c...ic/9280-python/




      1 user(s) are reading this topic

      0 members, 1 guests, 0 anonymous users