Please help

Syver Enstad syver at NOSPAMcyberwatcher.com
Wed Dec 20 15:55:26 EST 2000


>Would you kindly help clear up
> some of my doubts about Python?
I'll try ;-)
> 1. I want to use IIS 4.0 for my webserver, can I use scripts compiled
> by Python in it?
Yes, but the scripts are not compiled.
You'll have to:
1. setup IIS to run .py files when requested in the url.
To do this select the default web site from inetmgr. Select the home
directory page. Click the configuration button. A new property page dialog
appears. Select the app mappings page and add a new mapping.

In the path edit box write the path to the python interpreter python.exe
followed by "%s" %s. ex: c:\folder\python.exe "%s" %s.
Set the extension to .py. That should be all. Test that it really works by
making a .py file with only this content:

2. Make a test python script.
if __name__ == '__main__':
   import cgi
   cgi.test()

Put the file in a folder that is shared by the IIS and enter the path to the
file in your favorite browser. It should print out a whole load of stuff.

3. Read the documentation on the cgi module to find out more about cgi
programming under python.



> 2. What about the ASP? If I want to use ASP, can I use Python to do
> such jobs like user authentication?
Yes.

>How well can Python be used in Web
> programming on Windows platform?
About as well as VbScript and Jscript I suppose if you're talking ASP. The
only limitation in my experience is that you can't do like this:
<%
if so and so:
%>
    html code here
<%
else:
%>
    html code here

Python has got libraries that you can use to the fullest extent where you'll
have to build COM objects in either VB (urhkhh!) or C++.

>It seems that I can not make a .exe file for it to execute.
Yes.
>It is dependent on the interpreter?
Yes. But there are ways making installations that packs together the
interpreter and your code, I don't have any experience with these, so that's
really all I can say.

> 4. If I really sit my self to Python, does it reward equally for the
> same effort in learning C? In the aspect of the quality of programs.
> Thank you in advance for answering my questions.

If you're thinking about productivity I guess you'll be handsomely rewarded
for choosing Python over C. What can only be expressed in C by writing many
lines of code can often be written in Python in just a few. On the other
hand there might be things you wish to do that is not possible in Python but
can be done in C, depends on what you want to do. Many modules in Python are
in fact written in C.





More information about the Python-list mailing list