#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2004
    Location
    USA
    Posts
    349
    Rep Power
    11

    Python To Cgi In Windows


    I was messing around with Apache on my Linux computer, so I decided just for kicks I would install it on my Windows computer. Now, my question is, how do I create a .cgi file in Windows in the Python language. Its not like I can save something as .cgi, I must have to compile it somehow... Can someone help me with this?
  2. #2
  3. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    14
    I don't have Apache on Windows set up at the moment but from memory:

    The setup of CGI is very much the same as it is for Linux. Place the file in directory that you have configured for CGI use. (The Apache documents explain this and if you Google apache windows CGI you'll also find additional help).

    You need to have the path to python as the first line in the python module:

    #! c:\python23\python.exe

    So that Apache knows where to find the executable.

    grim
  4. #3
  5. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Nope, no compilation. Its exactly the same setup as on *nix except the path you put at the top of you're CGI file is the path to Python on your windows system - like grim said. It's really easy to set up actually so i don't think you'll have any problems with it .

    Have fun,

    Mark.
    programming language development: www.netytan.com Hula


IMN logo majestic logo threadwatch logo seochat tools logo