News for hackers. Stuff that matters.
Re:Why Awk for AI? (1997) by shawabawa3 on Friday May 17, 2013 @06:06PM (#5726919)
The difference between "pretty easy" and "easy" changes everything.

Compare

  from subprocess import call
  call(["ls", "-l"])
to

  `ls -l`
Re:Why Awk for AI? (1997) by bashinator on Friday May 17, 2013 @08:33PM (#5727428)
I really like the python sh library for stuff like this. Would you rather do what you wrote, or this?

    for listing in ls('-l'):
        '''etc'''
Here's the library in question - https://pypi.python.org/pypi/pbs - it makes me super happy to do shell work in python.
Re:Why Awk for AI? (1997) by CatMtKing on Saturday May 18, 2013 @02:00AM (#5728050)
Wow, that's a neat library. You can just import any program and use it like a function (from sh import grep)! Thanks for the link. Also, sh documentation: http://amoffat.github.io/sh/
Re:Why Awk for AI? (1997) by bashinator on Sunday May 19, 2013 @03:06PM (#5734036)
Yeah, it's replaced just a ton of boilerplate `def run(*args):` functions wrapping Popen. I couldn't be happier.
Re:Why Awk for AI? (1997) by mkarttic on Saturday May 18, 2013 @04:42AM (#5728292)
i use Sh to interface with my cmus player. from sh import cmus_remote! :)