News for hackers. Stuff that matters.
Re:How Ruby is beating Python in the battle for the Soul of ... by kstrauser on Monday October 03, 2011 @09:52AM (#3066251)
The Python example is completely broken. It'd be something like:

    import os
    if 'vmware' in os.popen('dmidecode').upper():
        print 'this is a vmware vm'
    else:
        print 'this is not a vmware vm'
I like regexps as much as the next ex-Perl hacker, but sometimes a little string manipulation is a lot better.
Re:How Ruby is beating Python in the battle for the Soul of ... by subleq on Monday October 03, 2011 @06:50PM (#3068522)
The condition will always evaluate to False, a lower-case string can't be in a string that has been .uppper()ed. popen(...).lower() will work.
Re:How Ruby is beating Python in the battle for the Soul of ... by bryanwb on Monday October 03, 2011 @11:08AM (#3066544)
fixed, tks