Re: modpython, apache and windows

2005-01-04 Thread Bob Van Zant
Fortunately most of the Python-for-the-web implementations do not follow
closely to the PHP paradigm of web-based programming. There are some,
like PSP, that more closely model what PHP does.

It is not uncommon to have something like index.py which does hardly
anything except fire up a framework that takes care of parsing the rest
of the URI and passing control over to the proper script. Using some
relatively cryptic features of Apache you can hide the fact that
everything goes through index.py (mod_rewrite).

You might be interested in the Aquarium web framework
(http://aquarium.sf.net). It provides a very flexible, mature framework
for developing web applications including a session manager, a form
validation library and a form generation "widget" among many other
things. The documentation on the official aquarium site is fairly
cryptic but I have written a few more intro documents at
http://bob.norcalttora.com including an example excerpt of an httpd.conf
file that will configure mod_python to work with Aquarium including the
previously mentioned apache rewrite rules.

I have never tried to get this working in windows but if you get it
working I'd be very interested in seeing what changes you had to make.
I'm willing to help you along the way.

Not really sure how else to help you at this point. The index.py that
you had working was probably on the right track.

-Bob


On Wed, 2005-01-05 at 01:12 +, Sam wrote:
> Hi All,
> 
> I am interested in learning python since I am hearing more and more 
> about python for use in web development
> 
> I am starting out on python, with knowledge of PHP some perl
> 
> my current hurdle is setting up either apache 1 or 2 with python 2.3.3 I 
> have installed modpython fine
> 
> which informed me that I need to make some configuration changes to 
> httpd.conf
> 
> I have not had it working yet, searches on the web give conflicting 
> suggestions and so far has confused me
> 
> some forums mention spyce and serving .spy files
> 
> so far I  one explanation worked in that a .py file was parsed but I had 
> to set the name of the actual file within apache.conf
> this seems strange
> 
> thanks in advance >> SS
> 
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.298 / Virus Database: 265.6.7 - Release Date: 30/12/2004
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: copying classes?

2004-12-29 Thread Bob Van Zant
copy.deepcopy() should do the trick. This URL answers a little bit of
your question about the difficulties in copying "complex" data
structures.

http://pydoc.org/2.3/copy.html

-Bob

On Wed, 2004-12-29 at 19:29 +0100, harold fellermann wrote:
> Hi all,
> 
> In the documentation of module 'copy' it is said that "This version 
> does not copy types like module, class, function, method, stack trace, 
> stack frame, file, socket, window, array, or any similar types."
> 
> Does anyone know another way to (deep)copy objects of type class? What 
> is special about the objects of these types that they cannot be easily 
> copied?
> 
> Any help appreciated,
> 
> - harold -
> 
> 
> --
> I like pigs. Dogs look up to us. Cats look down to us.
> Pigs treat us as equal.
> -- Winston Churchill
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: copying classes?

2004-12-29 Thread Bob Van Zant
Ha. I just read down to the bottom of pyDoc page.

"This version does not copy types like module, class, function, method,
nor stack trace, stack frame, nor file, socket, window, nor array, nor
any similar types."

However, I actually tried it and it worked at least in the simple case:
>>> class x:
...   def __init__(self):
... self.y = 1
...
>>> obj = x()
>>> obj.y
1
>>>
>>> import copy
>>> z = copy.deepcopy(obj)
>>> z.y
1
>>> obj.y = 4
>>> obj.y
4
>>> z = copy.deepcopy(obj)
>>> z.y
4

-Bob

On Wed, 2004-12-29 at 10:42 -0800, Bob Van Zant wrote:
> copy.deepcopy() should do the trick. This URL answers a little bit of
> your question about the difficulties in copying "complex" data
> structures.
> 
> http://pydoc.org/2.3/copy.html
> 
> -Bob
> 
> On Wed, 2004-12-29 at 19:29 +0100, harold fellermann wrote:
> > Hi all,
> > 
> > In the documentation of module 'copy' it is said that "This version 
> > does not copy types like module, class, function, method, stack trace, 
> > stack frame, file, socket, window, array, or any similar types."
> > 
> > Does anyone know another way to (deep)copy objects of type class? What 
> > is special about the objects of these types that they cannot be easily 
> > copied?
> > 
> > Any help appreciated,
> > 
> > - harold -
> > 
> > 
> > --
> > I like pigs. Dogs look up to us. Cats look down to us.
> > Pigs treat us as equal.
> > -- Winston Churchill
> > 
> 

-- 
http://mail.python.org/mailman/listinfo/python-list