From 366f811636272c6fe048f4ad7ccc0c2da6ea7e0d Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 29 Sep 2006 14:57:54 +0000 Subject: [PATCH] add support for text file from stdin add support for text file from stdin --- python/aubio/txtfile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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() -- 2.26.2