shithub: aubio

Download patch

ref: 366f811636272c6fe048f4ad7ccc0c2da6ea7e0d
parent: d88ea0643eca24eb5f5d4a9fa6b777872fd1a67f
author: Paul Brossier <piem@altern.org>
date: Fri Sep 29 10:57:54 EDT 2006

add support for text file from stdin
add support for text file from stdin


--- a/python/aubio/txtfile.py
+++ b/python/aubio/txtfile.py
@@ -22,7 +22,11 @@
 
 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()