Moving to Python from PHP - 3 questions

Diez B. Roggisch deetsNOSPAM at web.de
Sun Feb 20 15:50:14 EST 2005


Hi,

> 2) Session management. Cookie-based sessions in PHP are pretty
> transparent, with a small library of basic functions that do 95% of
> what anyone may need to store session data in serialized files and
> associate them with cookies. I've seen python code that accomplishes
> this, but so far no pre-built server-side session management modules.

The python-based zope application server has session management. Togther
with a built-in user and access rights management. 

> 3) Structured request variables. PHP has a really handy feature where
> request variables with name like "foo[]", "foo[bar]", or
> "foo[bar][baz]" are automatically structured into nested associative
> arrays. I can see that the python cgi module will make a list of
> MiniFieldStorage objects when more than one variable with the same name
> is provided, but that's about the extent of it that I've seen.

This can be done in zope if you name a variable <name>:list. That then will
give you the variable as list regardless of the number of occurences.

> 
> An "RTFM" answer with a URL for the M would be great. :)

For zope: http://www.zope.org/

But there are plenty of other python http frameworks. The mod_python is
AFAIK the most basic and primitive one. But build on top of it or fully
python-based you have plenty of options. Google is your friend - this NG
features similar discussions every other week.


-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list