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
2222
2323 def read_datafile(filename,depth=-1):
2424 """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')
2630 l = []
2731 while 1:
2832 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