script de informacion para linux practica
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-----------# | |
## Python: ## | |
#-----------# | |
#!/usr/bin/env python | |
import subprocess | |
def funcion_uname(): | |
uname = "uname" | |
uname_arg = "-a" | |
print "Obteniendo informacion del sistema con el comando %s :\n" % uname -a | |
subprocess.call([uname, uname_arg]) | |
def funcion_disco(): | |
diskspace = "df" | |
diskspace_arg = "-h" | |
print "Obteniendo informacion del sistema con el comando %s :\n" % diskspace | |
subprocess.call([diskspace, diskspace_arg]) | |
def main(): | |
funcion_uname() | |
funcion_disco() | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hola!!
Parece que tienes un pequeño error sintáctico en la línea 12. Entiendo que quieres mostrar el comando que vas a ejecutar. Deberías hacer algo del estilo:
y si quieres hacer lo mismo con el comando df:
Un saludo!