Je program.py qui accepte un seul argument URL:python3 lire args de fichier sous Linux
python3 program.py http://www.xxx.xxx
et le code est quelque chose comme ça
def Video(url)
#do something
#with that url string
def Main():
parser = argparse.ArgumentParser()
parser.add_argument("url", help="Add URL", type=str)
args = parser.parse_args()
Video(args.url) # here most the list of urls from file
if __name__ == '__main__':
Main()
Mais je voudrais que mon programme lire l'URL d'un fichier, l'un après l'autre a terminé
Quelque chose comme ceci:
Python3 program.py < URLfile
Merci
Je voudrais être plus d'une ligne de texte dans le URLfile, eh oui –
juste vu cela et a changé ma réponse –