Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9344220
count.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
326 B
Subscribers
None
count.py
View Options
#!/usr/bin/env python
import
io
import
sys
def
linecount
(
filename
:
str
)
->
None
:
count
=
0
for
_
in
io
.
open
(
filename
)
.
xreadlines
():
count
+=
1
return
count
if
__name__
==
"__main__"
:
if
len
(
sys
.
argv
)
!=
2
:
print
(
"usage: count <infile>"
)
exit
(
-
1
)
print
(
linecount
(
sys
.
argv
[
1
]))
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Fri, Jul 4, 2:13 PM (9 h, 11 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3242362
Attached To
R230 provenance-tools
Event Timeline
Log In to Comment