aboutsummaryrefslogtreecommitdiff
path: root/scripts/peakogram-stream
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-11-14 15:15:23 +0100
committerThomas White <taw@physics.org>2017-11-14 15:15:34 +0100
commitd2d7bec98af6e9c207a4362eefbdb6fdd23e9c54 (patch)
tree6897f9a3ccb198b02fdb902d1230bb37e20b7837 /scripts/peakogram-stream
parent69e6dcc10d7ac96ba71b35a2908197a9a60ac20c (diff)
scripts/peakogram-stream: Handle "-" for input
Diffstat (limited to 'scripts/peakogram-stream')
-rwxr-xr-xscripts/peakogram-stream7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/peakogram-stream b/scripts/peakogram-stream
index a17670ce..22ce4680 100755
--- a/scripts/peakogram-stream
+++ b/scripts/peakogram-stream
@@ -79,7 +79,12 @@ n=0
in_list = 0
cell = []
-with open(args.i) as f:
+if args.i == "-":
+ f = sys.stdin
+else:
+ f = open(args.i)
+
+if f:
for line in f:
if line.find("Cell parameters") != -1: