• [^] # Re: Quelques éléments de réponse...

    Posté par . En réponse au message Mise en oeuvre d'une matrice 4x4. Évalué à 1.

    Le token maintenant isolé, j'aimerais ajouter le token en question dans une chaine de caractère.

    Le tout à envoyer dans une commande linux.

    Est-ce que le code suivant partant d'une string (str) serait correct ?

    path_begin = 'curl -XPOST http://domain/api/monitors/5.json?token='
    path_token = token_auth
    path_argu = ' -d '
    path_end = 'Monitor[Function]=Modect&Monitor[Enabled]=1'
    path_total = path_begin + path_token + path_argu + path_end
    print (path_total)
    os.system(path_total)