History

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

Paul Brossier committed 20 years ago

Commit 366f8111 parent d88ea061 file · +5 −1Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/aubio/txtfile.py+5−1
@@ -22,7 +22,11 @@ __LICENSE__ = """\ · 21 unmodified lines
22 22
23def read_datafile(filename,depth=-1):23def read_datafile(filename,depth=-1):
24 """read list data from a text file (columns of float)"""24 """read list data from a text file (columns of float)"""
25 fres = open(filename,'ro')25 if filename == '--' or filename == '-':
26 import sys
27 fres = sys.stdin
28 else:
29 fres = open(filename,'ro')
26 l = []30 l = []
27 while 1:31 while 1:
28 tmp = fres.readline()32 tmp = fres.readline()

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t