News for hackers. Stuff that matters.
Re:Why Awk for AI? (1997) by jjoonathan on Friday May 17, 2013 @02:55PM (#5726086)
I suspect it has more to do with stringing together the inputs/outputs of multiple programs, which is outright painful in python. The syntax is terribly verbose (import subprocess, use subprocess.call, refer to a few enum values in the subprocess package, wire them together which requires a line of code rather than a character). Worse, pipes are tricky to implement correctly. It's easy to deadlock the python process by overflowing a pipe's buffer (wait for exit to read the buffer, buffer fills before subprocess exit, deadlock), so people who don't have an intimate knowledge of the underlying implementation will find themselves stuck with a bug they can't fix.

Compare this to a shell where the combination of &&, ||, and | can fit on a single line what would have taken dozens of lines of python.

Re:Why Awk for AI? (1997) by sprayk on Friday May 17, 2013 @03:35PM (#5726302)
Ah, so using python for stuff bash is usually used for. I thought OP meant writing python scripts to be used as components of bash scripts.

For _that_ type of python, I usually use the sh module[0]. It handles piping pretty well, especially if you use StringIO to deal with the pipes. Unfortunately, return code-based conditionals are nowhere as simple as || and && are in shell.

[0] http://amoffat.github.io/sh/

Re:Why Awk for AI? (1997) by abraininavat on Friday May 17, 2013 @03:14PM (#5726205)
See https://github.com/kennethreitz/envoy

Example:

  >> r = envoy.run('uptime | pbcopy')