mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-06 17:30:59 +01:00
14 lines
273 B
Text
14 lines
273 B
Text
![]() |
#!/usr/bin/env python
|
||
|
import sys
|
||
|
|
||
|
if len(sys.argv) == 1:
|
||
|
f = sys.stdin.buffer
|
||
|
else:
|
||
|
f = open(sys.argv[1], 'rb')
|
||
|
|
||
|
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))
|