[Wapt] Peut on utiliser une variable avec la commande run(r'') ?

Bastien HERMITTE bhermitte at b2pweb.com
Wed Dec 13 11:18:05 CET 2017


Bonjour,

- Première solution :
run(r'"C:\chemin du programme" /S /fichier=%s' %  makepath(basedir, 
'mon-fichier-config.json'))

- Deuxième solution :
config = makepath(basedir, 'mon-fichier-config.json')
run(r'"C:\chemin du programme" /S /fichier=%s' % config)

Voir : https://docs.python.org/2/library/stdtypes.html#string-formatting

Cordialement,
Bastien

Le 13/12/2017 à 11:01, Latieule Joel a écrit :
>
> Bonjour à tous,
>
>
> J'ai fait de multiple essai avec la commande run pour intégrer une 
> variable python ou wapt mais cela ne semble pas possible. Est-ce un 
> problème de syntaxe ou un comportement habituel ?
>
> Idéalement je tenterai :
>
> run(r'"C:\chemin du programme" /S /fichier='%makepath(basedir,'mon-fichier-config.json'))
>
> ou si makepath n'est pas utilisable tel quel :
>
> config = makepath(basedir,'mon-fichier-config.json')
> run(r'"C:\chemin du programme" /S /fichier='%config)
>
> En l'attente de vos conseils toujours aussi pertinent, je vous 
> remercie d'avance.
>
> -- 
> Joël LATIEULE - 06.38.02.33.27 / TICE
>
> Collège Victor Hugo - 0110021n
> 5 boulevard Marcel Sembat, 11100 Narbonne
> 04.68.90.24.00
>
>
> _______________________________________________
> WAPT mailing list
> WAPT at lists.tranquil.it
> http://lists.tranquil.it/listinfo/wapt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tranquil.it/pipermail/wapt/attachments/20171213/fb91c94b/attachment.html>


More information about the WAPT mailing list