[Tutor] Newbie here ... Have just downloaded Python 2.2.2 and am

Magnus Lyckå magnus@thinkware.se
Sun Jun 1 20:27:02 2003


At 14:46 2003-06-01 -0400, Dirigo wrote:
>getting ready to install it on a Win 98SE system.  But before I do ...

You can't get your hands on Win 2000 or XP? Not that Python
cares but in my opinion it's often useful to work partly with
the command prompt, and cmd.exe is far superior to the old DOS
command.com. I don't neet to tell you about Win98SE and stability
in general and so on.

>1.  What does the download actually consist of?   I assume the python
>interpreter and IDLE from what I read on the main web page of
>python.org?  But is there anything else included within this zipped
>package that I should be aware?

The very extensive standard library and documentation is also
included. If you get the ActivePython from ActiveState, or add
the win32all package, you will also get interfaces to the win32
API, with COM and a lot more.

>2.  I also assume I need to download apache to function as a web server.
>Is there a recommended specific apache version I should download that is
>compatible with Python-2.2.2.exe?

What does that mean? If you want to run Python CGI scripts, any
web server that handles CGI will work, from MS Personal Webserver
or whatever it's called to Xitami or Apache. If you don't like the
startup time of CGI, you might want to get an Apache with mod_python
included, but I have no clue about windows binaries for that.

You don't need any external Web Server though. There are web server
classes in the Python standard library, although that's nothing you
should use as is for any service available to the internet. You have
to add the security.

The increasingly popular Twisted framework www.twistedmatrix.com
provides a great web server as far as I understand. Other Python options
are Medusa or the Zope framework, but Zope gets you rather far from "normal"
Python coding.

Here is a very trivial web server coded in Python using only standard
modules. It's not really simple to undeerstand exactly what's happening,
since many modules are involved, but suffice to say that this is a
"Hello World" web server. Put the following lines in a python file,
run it, and aim your browser at http://localhost:8000/

import BaseHTTPServer, time

text = "<html><b>Hello</b> <i>World</i> at %s.</html>"

class myRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
     def do_GET(self, *args):
         self.send_response(200, "Script output follows")
         print >> self.wfile, "Content-type: text/html; charset=us-ascii"
         print >> self.wfile
         print >> self.wfile, text % time.asctime()

BaseHTTPServer.test(myRequestHandler, BaseHTTPServer.HTTPServer)

>3.  As of yet, I have not downloade Mark Hammond's Win32 extensions.
>Should I shortly ... after initial install?  I assume the extensions
>provide additional functionality, but, perhaps, it would be wise for me
>to hold off until I master the rudimentary functionality of python
>itself.  What are you folks' thoughts on this approach?

This has more to do with needs than with learning. If you want to
communicate with for instance MS Office via COM, you should get win32all
a.s.a.p. If you plan to write a pure python web app that might as well
run on a Linux box, you will never need win32all.


--
Magnus Lycka (It's really Lyck&aring;), magnus@thinkware.se
Thinkware AB, Sweden, www.thinkware.se
I code Python ~ The shortest path from thought to working program