2023-04-04 20:14:35 +02:00
|
|
|
import argparse
|
|
|
|
|
|
|
|
def count_lines(input_file):
|
|
|
|
with open(input_file) as file:
|
|
|
|
num_lines = sum(1 for line in file)
|
|
|
|
return num_lines
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
parser = argparse.ArgumentParser(description='Number of lines')
|
|
|
|
parser.add_argument('--input_file', type=str, help='file path')
|
|
|
|
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
num_lines = count_lines(args.input_file)
|
2023-04-04 20:15:54 +02:00
|
|
|
print(f'--input_file lines number: {num_lines}')
|