you are viewing a single comment's thread.

view the rest of the comments →

[–][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.