Ci-dessous, les différences entre deux révisions de la page.
| 
                    materiel:rpi:video:accueil [2016/12/05 18:50] resonance créée  | 
                
                    materiel:rpi:video:accueil [2016/12/05 18:51] (Version actuelle) resonance  | 
            ||
|---|---|---|---|
| Ligne 18: | Ligne 18: | ||
| Control - C pour terminer | Control - C pour terminer | ||
| - | + | SCRIPT #1 - subprocess | |
| - | + | ||
| - | + | ||
| - | + | ||
| - |      | + | |
| - | + | ||
| - | la meilleur technique par toons : | + | |
| import subprocess | import subprocess | ||
| - | |||
|     subprocess.call([' |     subprocess.call([' | ||
| - | + |      | |
| - | + | ||
| - | + | ||
| - |      | + | |
| import os | import os | ||
| - | |||
|     TheCommand =" |     TheCommand =" | ||
| - | |||
| os.system(TheCommand) | os.system(TheCommand) | ||
| - | |||
| SCRIPT #3 - argument | SCRIPT #3 - argument | ||
| - | |||
| import os | import os | ||
| - | |||
| import argparse | import argparse | ||
| - | |||
| parser = argparse.ArgumentParser() | parser = argparse.ArgumentParser() | ||
| - | |||
|     parser.add_argument(" |     parser.add_argument(" | ||
| - | |||
| args = parser.parse_args() | args = parser.parse_args() | ||
| - | |||
|     os.system(" |     os.system(" | ||
| + | SCRIPT #4- keyboard | ||
| + | import os | ||
| + |     val = input(" | ||
| + | print type(val) | ||
| + |     os.system(" | ||
| + | |||
| + | |||
| + | |||
| + | SCRIPT #5- keyboard (mieux) | ||
| + | import os | ||
| + |     val = input(" | ||
| + | val2 = 90 | ||
| + |     command = " | ||
| + | os.system(command) | ||