Boucle for problème argument
Bonjour
Je débute dans le langage python
Je me confronte déjà a un problème :
J aimerais passer en paramètre un tableau php dans mon fichier python
Voici ma commande php:
Code:
1 2
| $tab_id = array(13,15);
exec('/usr/bin/python gpio_detect.py' .$tabid) |
mais pour simuler j exécute cette commande en ssh:
Code:
python2.7 gpio_detect.py [13,15]
Dans mon fichier python je narrive pas a boucler sur le tableau
Code:
1 2 3 4
| tab_input = sys.argv[1]
for gpio_input in tab_input:
print gpio_input |
resultat :
Comment faire pour afficher
13
15
En vous remerciant