Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -22,7 +22,11 @@ __LICENSE__ = """\ · 21 unmodified lines | |||
| 22 | 22 | ||
| 23 | def read_datafile(filename,depth=-1): | 23 | def 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() |