(Py) Moduł Click*

Moduł Click

DD

Przykładowy kod Click

# All program parameters function:

configuration = {}

@click.command()
@click.option("-p", "--port", type=int, default=22, help="Provide SSH port number (Default: 22)")
@click.option("-t", "--devicetype", type=str, default="cisco_xe", help="Provide type of devices (Default: cisco_xe)")
@click.option("-u", "--username", type=str, default="admin", help="Provide username (Default: admin)")
@click.option("-f", "--filename", type=str, default="devices.csv", help="Provide csf filename (Default: devices.csv)")
def runCli(port, devicetype, username, filename):
    self.configuration["port"] = port
    self.configuration["type"] = devicetype
    self.configuration["username"] = username
    self.configuration["devices_file"] = filename

if __name__ == '__main__':
    runCli()

Pozostałe tematy związane z bibliotekami / modułami Python

Podstawowe

Rozszerzone

SQL

PyQt 5

Automatyzacja

Data Mining

PDFPRINT

Robert T Kucharski

Cisco Network Engineer in GPW.

Dodaj komentarz