Show More
@@ -17,16 +17,17 If INPUT is '-', stdin is used. | |||
|
17 | 17 | |
|
18 | 18 | """ |
|
19 | 19 | |
|
20 | import sys | |
|
21 | from IPython.utils.py3compat import PY3 | |
|
22 | (inpath, outpath) = sys.argv[1:] | |
|
23 | ||
|
24 | if inpath == '-': | |
|
25 | if PY3: | |
|
26 | infile = sys.stdin.buffer | |
|
20 | if __name__ == '__main__': | |
|
21 | import sys | |
|
22 | from IPython.utils.py3compat import PY3 | |
|
23 | (inpath, outpath) = sys.argv[1:] | |
|
24 | ||
|
25 | if inpath == '-': | |
|
26 | if PY3: | |
|
27 | infile = sys.stdin.buffer | |
|
28 | else: | |
|
29 | infile = sys.stdin | |
|
27 | 30 | else: |
|
28 |
infile = |
|
|
29 | else: | |
|
30 | infile = open(inpath, 'rb') | |
|
31 | infile = open(inpath, 'rb') | |
|
31 | 32 | |
|
32 | open(outpath, 'w+b').write(infile.read()) | |
|
33 | open(outpath, 'w+b').write(infile.read()) |
General Comments 0
You need to be logged in to leave comments.
Login now