When the “Python Vs PHP” war matters

February 21st, 2008

Yesterday I had a meet­ing with a cus­tomer about a new site I should develop for them. Since they’re a book pub­lisher, they wanted an online book store. Apart from the tech­ni­cal details (the site isn’t as simple as you may believe, they need a lot of not-so-easy-to-do stuff), the most impor­tant point we focused on is the fact that they have an inter­nal IT tech­ni­cian that han­dles all their com­puter needs. If you’re asking your­self why this mat­ters, keep reading:

  • me (to be precise, my company) stopped development of PHP sites about one year ago in favor of Python
  • we release the web site’s code to them
  • for this project, we haven’t been asked any kind of future support; this means that when the site is finished, we won’t touch the product anymore (unless they don’t pay us to do the modifies they need)
  • but they don’t want to pay us to these modifies, because they have their internal IT technician
  • their technician knows only PHP (and he never even known the Python’s existence until yesterday)

(Con­tinue reading…)

5 Comments, tagged with Coding, Django, PHP, Python, Web

Python listdir order

February 15th, 2008

Just a quick tip. If you’re using the python’s os.listdir() func­tion you may be not happy at all with the way it orders results. The fol­low­ing code snip­pet orders the result of the list­dir so it shows direc­to­ries first and then files, and sorts these two groups alphabetically:

import os
def custom_listdir(path):
    """
    Returns the content of a directory by showing directories first
    and then files by ordering the names alphabetically
    """
    dirs = sorted([d for d in os.listdir(path) if os.path.isdir(path + os.path.sep + d)])
    dirs.extend(sorted([f for f in os.listdir(path) if os.path.isfile(path + os.path.sep + f)]))

    return dirs

2 Comments, tagged with Coding, Python

Microblogging

  • Funny thing: yesterday night I had an idea about a good blog post I could make. But now I completely forgot what that idea was about. 13 hours ago #
  • I think pownce has a little issue with caching since if I delete a message and I write a new one, it doesn't appear in my homepage. Nov 16, 6:34pm #
  • I didn't know that something like [(x,y) for x in range(10) for y in range(x)] was possible in Python. Nov 16, 3:45pm #
  • I'm about to go to the local LUG dinner: pizza for everyone. Nov 14, 9:15pm #
  • Lately I've been very interested in fast data structures with minimum memory usage. Just surprised to find out that list comprehension in Python are sometimes slower for large quantities of data than classic for loops. Still trying to understand why (if someone has a clue, please let me know). Nov 12, 12:44pm #
  • So wordpress was silently modifying HTTP request headers and I was getting a 400 when fetching Pownce RSS. Now everything works as expected on my blog, shame on WP. Nov 9, 3:58pm #
  • Experimenting with document language identification. Nov 6, 10:23pm #
  • So looks like I finally found an interesting topic apart from web development: information retrieval. Nov 3, 5:13pm #
  • Planning a trip to Bologna in December Nov 1, 5:24pm #
  • After today, I want to go as far as I can from Italy. Oct 29, 11:49am #

Search


« Authored by Giuliani Vito Ivan »