• Randy Glenn (unregistered)

    "for a in existing if not a in db_list_names"

    I think I just fell in love with Python

  • Ron (unregistered)

    this is nice. don't forget (what appears to be) the plaintext admin password.

  • Eric Hodel (unregistered)

    Please remove the host, password and comment from lines 11 through 13. I don't think the db admin would be happy having those floating about

  • Stian Søiland (unregistered)

    The live password WAS present, but I changed it in the code before submitting. The mysql server wouldn't be too hard to guess, so no point of leaving that out =)

    And yes - the admin_group_ro account had NO password until I re-discovered this code - a mysql database open for the world to connect and have fun with reading other users mailman passwords... (now how funny would that really be? =)

  • Stian Søiland (unregistered)

    List comprensions [x for x in a if x not in b] are nice if written short enough, but Python also has Sets which makes this even nicer.

    Typical:

    from sets import Set
    a=Set(1,2,3,4)
    b=Set(3,2)
    not_in_b = a - b

  • David Totzke (unregistered)

    I'm blind!

  • Ming Chen(VSData) (unregistered)

    You guys are too harsh on the coder. This looks like (from @studs.ntnu.no)a student project -- Oh yea, NTNU is a school and let student to ..... My gut feeling is that this is a student(may be parttime) who just did it for just making them to work. (with more Python knowledge but minimum SQL knowledge) Somehow a "pet" project become a release product.

    I remember when I first learn about coding, the database i was using is just as well without any password (In DB1001 "Intro to database". who care about security in DB1001--I just barely made the final demo running in the "certain" demo path without crashing too badly. ;))

    -Ming

  • spiked (unregistered)

    Which editor is the one in the picture? Visual Studio?

  • Alex Papadimoulis (unregistered)

    The editor pictured is EditPlus. I generally open code files with that because it does syntax hilighting.

    http://editplus.com

  • David Turner (unregistered)

    I think this is a bit unfair on the guy. It's actually pretty spiffy Python code. And perhaps building and installing a database driver wasn't quite as simple as apt-get install python-mysql, and perchance he didn't really have the time or inclination to learn how to use it (since one database API tends to be quite different from the next in Python).

    Give the man a break!

Leave a comment on “Because database drivers can be too complex”

Log In or post as a guest

Replying to comment #:

« Return to Article