Вот мой простой скрипт «myscript.py»:
Код: Выделить всё
#! /usr/bin/env python3
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('url', help='input URL')
args = parser.parse_args()
print('This is the argument')
print(args.url)
и он выводит:< /p>
Код: Выделить всё
This is the argument
https://www.bbc.co.uk
Сценарий должен запускаться необходимое количество раз для вывода результатов в зависимости от количества URL-адресов в создаваемом файле urls.csv (например):
Код: Выделить всё
This is the argument
https://www.bbc.co.uk
This is the argument
https://www.itv.com
This is the argument
https://www.channel4.com
This is the argument
https://www.channel5.com
Подробнее здесь: https://stackoverflow.com/questions/790 ... a-csv-file
Мобильная версия