473,545 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python vs PHP

Can Python replace PHP?
Can I use a python program to make an interface to a mysql 4.X database?
If that's possible where can I find a tutorial?
Jul 18 '05 #1
29 11648
Hi !

PHP-5 let down MySql, for Sql-Lite (rumor ?)

Python has good support for MySql AND Sql-Lite.

@+

Michel Claveau
Jul 18 '05 #2
In article <ma************ *************** ******@python.o rg>,
Catalin <ad****@ploiest i.astral.ro> wrote:

Can Python replace PHP?
Can I use a python program to make an interface to a mysql 4.X database?


The short answer is "yes" to both questions, but with a caveat: Python is
a general-purpose programming language, where PHP is designed to write
web applications. So it's not quite as simple/straightforward to use
Python the same way you use PHP for plain web pages; conversely, if
you've been running into difficulty with PHP in trying to write
complicated program logic, you'll find Python a big help.
--
Aahz (aa**@pythoncra ft.com) <*> http://www.pythoncraft.com/

"Not everything in life has a clue in front of it...." --JMS
Jul 18 '05 #3
News M Claveau /Hamster-P wrote:
Hi !

PHP-5 let down MySql, for Sql-Lite (rumor ?)


PHP 5 won't come bundled with a default MySql lib, but anyone is still
free to link against the official MySQL lib, one way or another...

And yes, the default 'bundled-in' SQL lib should be Sql-lite.

Bruno

Jul 18 '05 #4
On Mon, 07 Jul 2003 13:47:00 +0300, Catalin
<ad****@ploiest i.astral.ro> wrote:
Can Python replace PHP?
Sure. Look at http://spyce.sourceforge.net
Can I use a python program to make an interface to a mysql 4.X database?
Of course, you can. http://www.python.org/sigs/db-sig/
E.g. http://dustman.net/andy/python/MySQLdb_obsolete
If that's possible where can I find a tutorial?

http://www.python.org/doc/Newbies.html
http://www.python.org/doc/current/
http://www.python.org/cgi-bin/faqw.py

--
JZ
Jul 18 '05 #5
On Tue, Jul 08, 2003 at 11:14:10AM +0200, Jaroslaw Zabiello wrote:
On Mon, 07 Jul 2003 13:47:00 +0300, Catalin
<ad****@ploiest i.astral.ro> wrote:
Can Python replace PHP?


Sure. Look at http://spyce.sourceforge.net


Lest the OP think Spyce is the only or even the preferred solution for web
programming with Python:

http://cherrypy.org/

http://www.twistedmatrix.com/

http://skunkweb.sf.net

http://webware.sf.net

http://zope.org

http://www.mems-exchange.org/software/quixote/

http://www.object-craft.com.au/projects/albatross

http://jonpy.sf.net

http://jotweb.tummy.com/

And let's not forget plain old CGI and mod_python.

Jp

--
"There is no reason for any individual to have a computer in their
home."
-- Ken Olson, President of DEC, World Future Society
Convention, 1977

Jul 18 '05 #6
On Mon, 07 Jul 2003 13:47:00 +0300, Catalin <ad****@ploiest i.astral.ro>
wrote:
Can Python replace PHP?
Can I use a python program to make an interface to a mysql 4.X database?
If that's possible where can I find a tutorial?


I recommend Spyce, Webware, or Quixote depending on your requirements,
but Draco, SkunkWeb, RoadKill are worth looking into as well. Spyce is
really the best (for PHP-ness) in my opinion, after you actually get past
the fact that it supports your old fashioned notion of what embedded
delimiters should look like, as well as a new CTS-friendly alternative.

Spyce is the closest thing to PHP, but also provides some features PHP
does not. However, I think you will find some people, like myself, who are
still unable to make the switch from PHP to Python for web development,
because of a lot of little things. These people know Python is better and
may even know their non-web PHP applications are hell compared to their
Python re-implementations . However, they still use PHP for web development
and feel they have to. They may have even written out all the requirements
and received vague responses to them.

Python web development is fragmented. Mod_python CVS now contains the work
of what used to be mod_psp by Sterling Hughes, a PHP warlord, I'm sure
he'll reply. This possibly soon to be official 'PSP' is not much in my
opinion and should probably not be folded into mod_python. Others agree:

http://www.modpython.org/pipermail/m...ne/003200.html

Another big problem with Python web development is the lack of good shared
hosting support. Primarily the lack of anything resembling PHP's safe
mode. Mod_python has no equivalent of this safe mode, but Apache 2's
'Perchild MPM' is supposed deprecates this need. However, this still
requires an httpd.conf edit and a restart of Apache for every user added,
very annoying, especially to a shared hosting service.

http://apache.slashdot.org/apache/02...206.shtml?tid=
http://httpd.apache.org/docs-2.0/mod/perchild.html
http://www.modpython.org/pipermail/m...er/001705.html

A couple other slight issues :

* catch-all error handling not as flexible or non-existent
* no equivalent to php_value auto_prepend_fi le "_header.ph p"
* no equivalent to php_value auto_append_fil e "_footer.ph p"
* not as intelligent form value handling
* white space sensitivity is a unique problem when embedding

The best options for me are currently :

* use PHP
* use Spyce
* fork Spyce (creating more fragmentation)
* embed python straight into my favorite platform (quite funny)
* write my own mod_python-based platform (more fragmentation)
* find the holy grail (i must have missed it)

I've been handling this dilemma for months. I've even benchmarked quite a
few possible solutions, with pleasing results in those which I thought
were well done, and pleasing results for Python over PHP in general.

-AB
Jul 18 '05 #7
In article <km************ *************** *****@4ax.com>, Afanasiy wrote:
A couple other slight issues :

* catch-all error handling not as flexible or non-existent
* no equivalent to php_value auto_prepend_fi le "_header.ph p"
* no equivalent to php_value auto_append_fil e "_footer.ph p"
* not as intelligent form value handling
* white space sensitivity is a unique problem when embedding


Try jonpy (http://jonpy.sf.net/), it solves all of the above.
Also you may find FastCGI (which jonpy supports) helps with your
"safe mode" problem, although it might require a bit of hackery.
Jul 18 '05 #8
On Tue, 08 Jul 2003 15:56:58 GMT, Afanasiy <ab********@hot mail.com> wrote:
On Mon, 07 Jul 2003 13:47:00 +0300, Catalin <ad****@ploiest i.astral.ro>
wrote: A couple other slight issues :

* catch-all error handling not as flexible or non-existent
* no equivalent to php_value auto_prepend_fi le "_header.ph p"
* no equivalent to php_value auto_append_fil e "_footer.ph p"
* not as intelligent form value handling
* white space sensitivity is a unique problem when embedding


I think I should add import, pythonpath and module caching to this list.
These are much more annoying than PHP's inclusion mechanisms. I am even
annoyed in non-web applications by them quite often, but not necessarily
all at the same time.

Also add to the list, the need for PyChecker. You must run PyChecker
to discover errors which would occur on a section of logic being hit
which contained a silly typographical error. PHP would discover these
without them being hit, when you were developing the page.

Python is more beautiful and more powerful, but for this purpose I
consider the current implementations still lacking compared to PHP.
So much so that I am unable to bring myself to write new PHP, but
unable to continue using Python until I find the perfect implementation.

-AB
Jul 18 '05 #9
On 8 Jul 2003 16:02:48 GMT, Jon Ribbens <jo********@une quivocal.co.uk>
wrote:
In article <km************ *************** *****@4ax.com>, Afanasiy wrote:
A couple other slight issues :

* catch-all error handling not as flexible or non-existent
* no equivalent to php_value auto_prepend_fi le "_header.ph p"
* no equivalent to php_value auto_append_fil e "_footer.ph p"
* not as intelligent form value handling
* white space sensitivity is a unique problem when embedding


Try jonpy (http://jonpy.sf.net/), it solves all of the above.
Also you may find FastCGI (which jonpy supports) helps with your
"safe mode" problem, although it might require a bit of hackery.


No, CGI is not an option and I tried jonpy. I kept my notes about it...
Jul 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
7692
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7946
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7791
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6026
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5360
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1045
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
744
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.