How to enable Python Scripts with MS IIS Web Server?

Discussion in 'Python' started by syed_saqib_ali@yahoo.com, Feb 4, 2005.

  1. Guest

    Hi. I have MS Windows Server 2003, Enterprise Edition.
    It has MS Management Console 2.0, Version 5.2
    and IIS Manager 6.0



    I have a directory called "myDirs". Within this directory are 2 files:
    1) index.pl (a perl script)
    2) index.py (a python script whose first line is
    "#!C:\Python21\pythonw.exe")

    The webserver is listening on port 8080.

    When I point my browser to http://localhost:8080/myDirs/index.pl, it
    works... I see the output of the perl script.

    HOWEVER,
    When I point my browser to http://localhost:8080/myDirs/index.py, it
    simply shows the python file as text. It doesn't interpret it at all.

    How Can I get it to interpret the python file using the interpreter and
    display the output in the browser?

    Please explain each step in careful/excruciating detail because I'm a
    windows Newbie.


    -Saqib Ali
    , Feb 4, 2005
    #1
    1. Advertising

  2. jb Guest

    hi,

    you should first install win32all :
    http://starship.python.net/crew/mhammond/

    next, 2 ways 2 proceed, but the first is the easier :

    you make a "test.asp" page in the folder

    at the top, you write <@Language=Python%>

    a line below : <%Response.Write("Hello World")%>

    try if the page works well. if it works then your python/iis install is
    ok

    the second way is to keep the .py extension and to associate it with the
    python executable

    http://support.microsoft.com/default.aspx?scid=kb;en-us;276494

    hope this helps


    juju



    <> a écrit dans le message de news:
    ...
    >
    >
    >
    > Hi. I have MS Windows Server 2003, Enterprise Edition.
    > It has MS Management Console 2.0, Version 5.2
    > and IIS Manager 6.0
    >
    >
    >
    > I have a directory called "myDirs". Within this directory are 2 files:
    > 1) index.pl (a perl script)
    > 2) index.py (a python script whose first line is
    > "#!C:\Python21\pythonw.exe")
    >
    > The webserver is listening on port 8080.
    >
    > When I point my browser to http://localhost:8080/myDirs/index.pl, it
    > works... I see the output of the perl script.
    >
    > HOWEVER,
    > When I point my browser to http://localhost:8080/myDirs/index.py, it
    > simply shows the python file as text. It doesn't interpret it at all.
    >
    > How Can I get it to interpret the python file using the interpreter and
    > display the output in the browser?
    >
    > Please explain each step in careful/excruciating detail because I'm a
    > windows Newbie.
    >
    >
    > -Saqib Ali
    >
    jb, Feb 4, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick
    Replies:
    1
    Views:
    648
  2. Jan Danielsson
    Replies:
    8
    Views:
    620
    Mike Meyer
    Jul 22, 2005
  3. Jp Calderone
    Replies:
    0
    Views:
    449
    Jp Calderone
    Jul 21, 2005
  4. davidj411
    Replies:
    0
    Views:
    492
    davidj411
    Jun 27, 2008
  5. IronyOfLife
    Replies:
    7
    Views:
    452
    Gabriel Genellina
    Aug 11, 2009
Loading...

Share This Page