15 lines
299 B
Python
15 lines
299 B
Python
|
#!/usr/bin/env python
|
||
|
|
||
|
import sys
|
||
|
|
||
|
filename = sys.argv[1]
|
||
|
|
||
|
with open(filename, "r") as fileobj:
|
||
|
data = fileobj.read()
|
||
|
|
||
|
max_linelength = 0
|
||
|
for line in data.splitlines():
|
||
|
max_linelength = max(max_linelength, len(line))
|
||
|
|
||
|
print(f"The longest line has a length of {max_linelength}.")
|