Логический аргумент для сценарияPython

Программы на Python
Гость
Логический аргумент для сценария

Сообщение Гость »


In Python, I understand how int and str arguments can be added to scripts.

parser=argparse.ArgumentParser(description="""Mydescription""") parser.add_argument('-l', type=str, default='info', help='String argument') parser.add_argument('-dt', type=int, default ='', help='int argument') What is it for booleans?

Basically I want to pass a flag into my script which will tell the script whether to do a specific action or not.


Источник: https://stackoverflow.com/questions/918 ... for-script

Вернуться в «Python»