python:programmes:exec_cmd2
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédente | |||
python:programmes:exec_cmd2 [2013/03/12 22:16] – root | python:programmes:exec_cmd2 [2013/03/12 22:17] (Version actuelle) – root | ||
---|---|---|---|
Ligne 5: | Ligne 5: | ||
* Avec python2 | * Avec python2 | ||
<code python> | <code python> | ||
- | # import commands | + | >>> |
- | # ret, output = commands.getstatusoutput(' | + | >>> |
- | # print(ret) | + | >>> |
0 | 0 | ||
- | # print(output) | + | >>> |
total 12 | total 12 | ||
drwxr-xr-x 2 gigi users 4096 9 janv. 00:24 Desktop | drwxr-xr-x 2 gigi users 4096 9 janv. 00:24 Desktop | ||
Ligne 19: | Ligne 19: | ||
<code python> | <code python> | ||
- | # import subprocess | + | >>> |
- | # ret, output = subprocess.getstatusoutput(' | + | >>> |
- | # print (ret) | + | >>> |
0 | 0 | ||
- | # print (output) | + | >>> |
total 12 | total 12 | ||
drwxr-xr-x 2 gigi users 4096 9 janv. 00:24 Desktop | drwxr-xr-x 2 gigi users 4096 9 janv. 00:24 Desktop |
python/programmes/exec_cmd2.1363126577.txt.gz · Dernière modification : 2013/03/12 22:16 de root