From: Paul Brossier Date: Fri, 29 Sep 2006 14:57:54 +0000 (+0000) Subject: add support for text file from stdin X-Git-Tag: bzr2git~553 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=366f811636272c6fe048f4ad7ccc0c2da6ea7e0d;p=aubio.git add support for text file from stdin add support for text file from stdin --- diff --git a/python/aubio/txtfile.py b/python/aubio/txtfile.py index fabafa55..2ce9f264 100644 --- a/python/aubio/txtfile.py +++ b/python/aubio/txtfile.py @@ -22,7 +22,11 @@ __LICENSE__ = """\ def read_datafile(filename,depth=-1): """read list data from a text file (columns of float)""" - fres = open(filename,'ro') + if filename == '--' or filename == '-': + import sys + fres = sys.stdin + else: + fres = open(filename,'ro') l = [] while 1: tmp = fres.readline()