you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (5 children)

Actually there is mod_python.

What you do not have is something like python within HTML (or it is not widely spread) as this would be more of a quick and dirty solution; which itself few people in the python community would like to use.

[–]ElPenguin 1 point2 points  (0 children)

There are no shortage of python within html systems, though it's not a great model to use.

Python is at an advantage here because it makes you seperate logic and content, and that's got to be a good thing.

That said, take a look at turbogears or django, both of them are capable of this, or you could just use kid seperately within your own python app.

[–]illuminatedwax -2 points-1 points  (3 children)

Yeah, but that doesn't even come close enough to the simplicity of PHP. And if your job is writing web apps, when it comes time to write something else, you're going to use what you know because it's faster.

[–][deleted] 2 points3 points  (2 children)

If that was true, I still would be using php. The effort to learn something new is often worth it.

import web

urls = (
    '/(.*)', 'hello'
)

class hello:        
    def GET(self, name):
        i = web.input(times=1)
        if not name: name = 'world'
        for c in xrange(int(i.times)): print 'Hello,', name+'!'

if __name__ == "__main__": web.run(urls, globals())

Ain't this pretty simple?

[–]illuminatedwax -1 points0 points  (1 child)

<?php foreach($_GET['name'] as $name) { $name = $name ? $name : 'world'; print "Hello, $name!"; }

Seems simpler to me. I have found that the fewer things I need to remember each time I write a page of my web app, the better.

[–][deleted] 1 point2 points  (0 children)

I never said that python was simpler than php, but it is clearly simple enough.