python vs php for web programming

M

mir nazim

i m currently using PHP with Apache (a.k.a 'mod_php') for my web
development work. i came to know that python can also be used to do
web programming using 'mod_python' for Apache. i wanted to know the
difference between th two 'mod_php' and 'mod_python' in terms of:

1. speed of execution.
2. productivity
3. maintainance
(i know python is most productive and maintainable language in the
world, but is it same for web programming with Apache).
4. availability of features e.g, cookies and session hadling,
databases, protocols, etc.

I also wanted to know about Zope and comparison of its proformance,
features, etc. with Apache.
 
A

Andrew Barilla

i m currently using PHP with Apache (a.k.a 'mod_php') for my web
development work. i came to know that python can also be used to do
web programming using 'mod_python' for Apache. i wanted to know the
difference between th two 'mod_php' and 'mod_python' in terms of:

1. speed of execution.
2. productivity
3. maintainance
(i know python is most productive and maintainable language in the
world, but is it same for web programming with Apache).
4. availability of features e.g, cookies and session hadling,
databases, protocols, etc.

I also wanted to know about Zope and comparison of its proformance,
features, etc. with Apache.

I think mod_python is more comparable to mod_perl from what I've seen
in terms of how you interact with the webserver.

Instead of mod_python though, I'm doing my web programming with
Webware (http://webware.sourceforge.net/), SQLObject
(http://www.sqlobject.org/) and FormKit
(http://dalchemy.com/python/formkit/). Compared to php I can code in
about 1/4 of the time. And I've actually been programming longer in
php than I have been in python. This combination is extremely
powerful and most importantly I can take advantage of existing python
code I have from a desktop application.

Both mod_python and webware have cookies and session handling.
Database access is through any available Python library such as
mysqldb (http://sourceforge.net/projects/mysql-python). Not sure what
protocols you're looking for but since you can use any python code
that's out there, I'm sure you'll find everything you'll need.

I played around with Zope until I tried to utilize Python code that
I've already written and then moved on.
 
E

email9898989

i m currently using PHP with Apache (a.k.a 'mod_php') for my web
development work. i came to know that python can also be used to do
web programming using 'mod_python' for Apache. i wanted to know the
difference between th two 'mod_php' and 'mod_python' in terms of:

1. speed of execution.
2. productivity
3. maintainance
(i know python is most productive and maintainable language in the
world, but is it same for web programming with Apache).
4. availability of features e.g, cookies and session hadling,
databases, protocols, etc.

I can't really give you "the answer" if there is one, but here are
some resources I've found helpful:

http://colorstudy.com/docs/shootout.html
http://www.python.org/cgi-bin/moinmoin/WebProgramming

If you want something similar to PHP, see Spyce. If you want to do
most of your coding in pure python, see Quixote or the cgi module. If
you want to use templates (like PHP with Smarty), then see Cheetah,
Albatross, etc. There are dozens of options now, but no one real
front runner popularity-wise (except maybe Cheetah for templates).

Realize though most web hosts out there though don't provide modpython
(or java for that matter), so try it out on your own computer first or
go with a python-friendly web host (some are also listed at the wiki).
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top