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

Python 3 intends to fix a lot of the stdlib issues. For example, the subprocess module should obsolete all of the various popens.

http://docs.python.org/library/subprocess.html



And subprocess is available in 2.6, too. It looks like a well-designed API and certainly makes it easy to run external filters on data. For example, to get the output of 'tidy -q' on a string s:

  proc = subprocess.Popen(['tidy', '-q'], stdin=PIPE, stdout=PIPE, stderr=PIPE)
  (tidyout, tidyerr) = proc.communicate(input=s)
  if proc.returncode != 0:
      ...


Errr, subprocess has been around since 2.4...




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

Search: