Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A little bit of python that makes it easier to do shell-style scripting.

    def call(cmd):
	args = shlex.split(str(cmd))
	p = Popen(args, stdout=PIPE, stderr=PIPE)
	text = p.stdout.read()
	if not text:
		text = p.stderr.read()
	return text


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: