mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00
15 lines
309 B
Python
Executable file
15 lines
309 B
Python
Executable file
#!/usr/bin/env python3
|
|
import sys
|
|
|
|
if len(sys.argv) == 1:
|
|
f = sys.stdin.buffer
|
|
doc = f.read()
|
|
else:
|
|
with open(sys.argv[1], 'rb') as f:
|
|
doc = f.read()
|
|
|
|
lines = len(doc.splitlines())
|
|
words = len(doc.split())
|
|
bytes = len(doc)
|
|
|
|
print(' {0} {1:>2} {2} {3}'.format(lines, words, bytes, f.name))
|